summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-waitpid.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-19 00:13:38 +1000
committerDamien Miller <djm@mindrot.org>2003-05-19 00:13:38 +1000
commit317412502b900ddecdafdfa171da99271846478b (patch)
tree2e04f618288cdf0c16a98b675b28b8287a15a0c6 /openbsd-compat/bsd-waitpid.c
parente323df6c4851b04386e747a009474f469fe97137 (diff)
- (djm) Big KNF on openbsd-compat/
Diffstat (limited to 'openbsd-compat/bsd-waitpid.c')
-rw-r--r--openbsd-compat/bsd-waitpid.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c
index 47b4446dc..d60081e58 100644
--- a/openbsd-compat/bsd-waitpid.c
+++ b/openbsd-compat/bsd-waitpid.c
@@ -1,3 +1,5 @@
1/* XXX - no author */
2
1/* 3/*
2 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
@@ -22,7 +24,7 @@
22 24
23#include "includes.h" 25#include "includes.h"
24 26
25RCSID("$Id: bsd-waitpid.c,v 1.3 2001/03/26 05:35:34 mouring Exp $"); 27RCSID("$Id: bsd-waitpid.c,v 1.4 2003/05/18 14:13:39 djm Exp $");
26 28
27#ifndef HAVE_WAITPID 29#ifndef HAVE_WAITPID
28#include <errno.h> 30#include <errno.h>
@@ -38,15 +40,16 @@ waitpid(int pid, int *stat_loc, int options)
38 if (pid <= 0) { 40 if (pid <= 0) {
39 if (pid != -1) { 41 if (pid != -1) {
40 errno = EINVAL; 42 errno = EINVAL;
41 return -1; 43 return (-1);
42 } 44 }
43 pid = 0; /* wait4() wants pid=0 for indiscriminate wait. */ 45 /* wait4() wants pid=0 for indiscriminate wait. */
46 pid = 0;
44 } 47 }
45 wait_pid = wait4(pid, &statusp, options, NULL); 48 wait_pid = wait4(pid, &statusp, options, NULL);
46 if (stat_loc) 49 if (stat_loc)
47 *stat_loc = (int) statusp.w_status; 50 *stat_loc = (int) statusp.w_status;
48 51
49 return wait_pid; 52 return (wait_pid);
50} 53}
51 54
52#endif /* !HAVE_WAITPID */ 55#endif /* !HAVE_WAITPID */