check the return value of setsid.

This commit is contained in:
christos 2006-06-03 16:02:30 +00:00
parent 2a606d89a3
commit 842c42957f
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: do_command.c,v 1.20 2006/05/21 19:26:43 christos Exp $ */ /* $NetBSD: do_command.c,v 1.21 2006/06/03 16:02:30 christos Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie /* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved * All rights reserved
@ -22,7 +22,7 @@
#if 0 #if 0
static char rcsid[] = "Id: do_command.c,v 2.12 1994/01/15 20:43:43 vixie Exp "; static char rcsid[] = "Id: do_command.c,v 2.12 1994/01/15 20:43:43 vixie Exp ";
#else #else
__RCSID("$NetBSD: do_command.c,v 1.20 2006/05/21 19:26:43 christos Exp $"); __RCSID("$NetBSD: do_command.c,v 1.21 2006/06/03 16:02:30 christos Exp $");
#endif #endif
#endif #endif
@ -194,7 +194,8 @@ child_process(entry *e, user *u)
#endif #endif
/* get new pgrp, void tty, etc. /* get new pgrp, void tty, etc.
*/ */
(void) setsid(); if (setsid() == -1)
syslog(LOG_ERR, "setsid() failure: %m");
if (setlogin(usernm) < 0) if (setlogin(usernm) < 0)
syslog(LOG_ERR, "setlogin() failure: %m"); syslog(LOG_ERR, "setlogin() failure: %m");