]> andersk Git - openssh.git/blobdiff - openbsd-compat/bsd-waitpid.c
- (bal) "extration" -> "extraction" in ssh-rand-helper.c; repoted by john
[openssh.git] / openbsd-compat / bsd-waitpid.c
index 10aaddb7efb2954d2d8ffbdcd45bb96c6d5ea6ef..918ce3589906ce244969b662ec8ceec1d696074d 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:
@@ -38,13 +40,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.278379 seconds and 4 git commands to generate.