]> andersk Git - openssh.git/blobdiff - openbsd-compat/bsd-waitpid.c
- (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused
[openssh.git] / openbsd-compat / bsd-waitpid.c
index 0bf4c7cd8bf3a866b6560d68f447b5680e4f15d2..40e6ffaa82d6665f8216d670e2c990616c119709 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * Copyright (c) 2000 Ben Lindstrom.  All rights reserved.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -36,13 +38,16 @@ waitpid(int pid, int *stat_loc, int options)
        if (pid <= 0) {
                if (pid != -1) {
                        errno = EINVAL;
-                       return -1;
+                       return (-1);
                }
-               pid = 0;   /* wait4() wants pid=0 for indiscriminate wait. */
+               /* wait4() wants pid=0 for indiscriminate wait. */
+               pid = 0;
        }
         wait_pid = wait4(pid, &statusp, options, NULL);
-        stat_loc = (int *)statusp.w_status;            
-        return wait_pid;                               
+       if (stat_loc)
+               *stat_loc = (int) statusp.w_status;            
+
+        return (wait_pid);                               
 }
 
 #endif /* !HAVE_WAITPID */
This page took 0.175818 seconds and 4 git commands to generate.