changeset 1766:b5ce32adceff

(mkdir): Use pid_t instead of int; check status against zero. This is to improve portability.
author Jim Meyering <jim@meyering.net>
date Tue, 30 Mar 1999 04:47:52 +0000
parents fe67c20349bf
children 88fe48b75cb8
files lib/mkdir.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/mkdir.c
+++ b/lib/mkdir.c
@@ -50,7 +50,8 @@
 int
 mkdir (const char *dpath, int dmode)
 {
-  int cpid, status;
+  pid_t cpid;
+  int status;
   struct stat statbuf;
 
   if (stat (dpath, &statbuf) == 0)
@@ -84,7 +85,7 @@
       while (wait (&status) != cpid)
 	/* Do nothing.  */ ;
 
-      if (status & 0xFFFF)
+      if (status)
 	{
 	  /* /bin/mkdir failed.  */
 	  errno = EIO;