summaryrefslogtreecommitdiff
path: root/sbin/init
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-12-11 21:58:38 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-12-11 21:58:38 +0000
commit3a0d341d13be684fef9c1200d8c3aa968dba880f (patch)
treebd26042e29343abf39f7d0d9a9b7d2d31bb3279f /sbin/init
parentffe9aa202ec71eb96cad569278090927639a9c8c (diff)
Minor cosmetic nits picked while reading though init.c:
o Use STD{IN,OUT,ERR}_FILENO, not 0-2 o Call exit() from main, not return() (code is never reached anyway) o Change two cases of '!' into "== NULL"
Diffstat (limited to 'sbin/init')
-rw-r--r--sbin/init/init.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 2cb517c1e87..b5f332f23ec 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.29 2002/10/10 23:27:54 millert Exp $ */
+/* $OpenBSD: init.c,v 1.30 2002/12/11 21:58:37 millert Exp $ */
/* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: init.c,v 1.29 2002/10/10 23:27:54 millert Exp $";
+static char rcsid[] = "$OpenBSD: init.c,v 1.30 2002/12/11 21:58:37 millert Exp $";
#endif
#endif /* not lint */
@@ -263,9 +263,9 @@ main(int argc, char *argv[])
/*
* Paranoia.
*/
- close(0);
- close(1);
- close(2);
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
/*
* Start the state machine.
@@ -275,7 +275,7 @@ main(int argc, char *argv[])
/*
* Should never reach here.
*/
- return (1);
+ exit(1);
}
/*
@@ -1096,10 +1096,10 @@ collect_child(pid_t pid)
{
session_t *sp, *sprev, *snext;
- if (! sessions)
+ if (sessions == NULL)
return;
- if (! (sp = find_session(pid)))
+ if ((sp = find_session(pid)) == NULL)
return;
clear_session_logs(sp);