summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-waitpid.c
diff options
context:
space:
mode:
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..93c9ec35e 100644
--- a/openbsd-compat/bsd-waitpid.c
+++ b/openbsd-compat/bsd-waitpid.c
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (c) 2000 Ben Lindstrom. All rights reserved.
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
4 * are met: 6 * are met:
@@ -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.5 2003/06/01 03:23:57 mouring 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 */