X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Frmdir.c;h=5315711c327c8d1c6ccd4197d3f91dd2efef0f9f;hb=9b9bfb49af70f53f177c7a6563fa844a4a50c7db;hp=fac5d44b5a315be335ebfe36137ec75d9189619d;hpb=6d8337bfc808cddc275899c03482eceb6aff8547;p=gnulib.git diff --git a/lib/rmdir.c b/lib/rmdir.c index fac5d44b5..5315711c3 100644 --- a/lib/rmdir.c +++ b/lib/rmdir.c @@ -1,5 +1,6 @@ -/* rmdir.c -- BSD compatible remove directory function for System V - Copyright (C) 1988, 1990 Free Software Foundation, Inc. +/* BSD compatible remove directory function for System V + + Copyright (C) 1988, 1990, 1999, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +16,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif #include @@ -27,12 +28,12 @@ extern int errno; #endif -#ifdef STAT_MACROS_BROKEN -#undef S_ISDIR +#if STAT_MACROS_BROKEN +# undef S_ISDIR #endif #if !defined(S_ISDIR) && defined(S_IFDIR) -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif /* rmdir adapted from GNU tar. */ @@ -41,10 +42,10 @@ extern int errno; Return 0 if successful, -1 if not. */ int -rmdir (dpath) - char *dpath; +rmdir (char const *dpath) { - int cpid, status; + pid_t cpid; + int status; struct stat statbuf; if (stat (dpath, &statbuf) != 0) @@ -73,7 +74,7 @@ rmdir (dpath) while (wait (&status) != cpid) /* Do nothing. */ ; - if (status & 0xFFFF) + if (status) { /* /bin/rmdir failed. */