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, 4 insertions, 7 deletions
diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c
index 93c9ec35e..47b4446dc 100644
--- a/openbsd-compat/bsd-waitpid.c
+++ b/openbsd-compat/bsd-waitpid.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * Copyright (c) 2000 Ben Lindstrom. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without 2 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 3 * modification, are permitted provided that the following conditions
6 * are met: 4 * are met:
@@ -24,7 +22,7 @@
24 22
25#include "includes.h" 23#include "includes.h"
26 24
27RCSID("$Id: bsd-waitpid.c,v 1.5 2003/06/01 03:23:57 mouring Exp $"); 25RCSID("$Id: bsd-waitpid.c,v 1.3 2001/03/26 05:35:34 mouring Exp $");
28 26
29#ifndef HAVE_WAITPID 27#ifndef HAVE_WAITPID
30#include <errno.h> 28#include <errno.h>
@@ -40,16 +38,15 @@ waitpid(int pid, int *stat_loc, int options)
40 if (pid <= 0) { 38 if (pid <= 0) {
41 if (pid != -1) { 39 if (pid != -1) {
42 errno = EINVAL; 40 errno = EINVAL;
43 return (-1); 41 return -1;
44 } 42 }
45 /* wait4() wants pid=0 for indiscriminate wait. */ 43 pid = 0; /* wait4() wants pid=0 for indiscriminate wait. */
46 pid = 0;
47 } 44 }
48 wait_pid = wait4(pid, &statusp, options, NULL); 45 wait_pid = wait4(pid, &statusp, options, NULL);
49 if (stat_loc) 46 if (stat_loc)
50 *stat_loc = (int) statusp.w_status; 47 *stat_loc = (int) statusp.w_status;
51 48
52 return (wait_pid); 49 return wait_pid;
53} 50}
54 51
55#endif /* !HAVE_WAITPID */ 52#endif /* !HAVE_WAITPID */