summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-30 04:47:52 +0000
committerJim Meyering <jim@meyering.net>1999-03-30 04:47:52 +0000
commit69952761e1679f69725e9932143b18c44bb72a9d (patch)
tree9bc7dd4318dd5decb6ef94ecc9c2df3045bb80cd
parent319976a665f5c023f8b5f2710f1ffacf074f84d3 (diff)
downloadcoreutils-69952761e1679f69725e9932143b18c44bb72a9d.tar.xz
(mkdir): Use pid_t instead of int; check status
against zero. This is to improve portability.
-rw-r--r--lib/mkdir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mkdir.c b/lib/mkdir.c
index 772c68676..5ca5af696 100644
--- a/lib/mkdir.c
+++ b/lib/mkdir.c
@@ -50,7 +50,8 @@ extern int errno;
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 @@ mkdir (const char *dpath, int dmode)
while (wait (&status) != cpid)
/* Do nothing. */ ;
- if (status & 0xFFFF)
+ if (status)
{
/* /bin/mkdir failed. */
errno = EIO;