From 77e4428e58ebc910bc125c56c7a896e286163900 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 19 Jun 2004 12:26:53 +0000 Subject: Remove all S_IS* and S_IF* definitions. Instead, just include "stat-macros.h". --- lib/isdir.c | 11 ++--------- lib/lchown.c | 13 +------------ lib/makepath.c | 42 ++++-------------------------------------- 3 files changed, 7 insertions(+), 59 deletions(-) diff --git a/lib/isdir.c b/lib/isdir.c index 01cf8d5e4..9f18b01bc 100644 --- a/lib/isdir.c +++ b/lib/isdir.c @@ -1,5 +1,5 @@ /* isdir.c -- determine whether a directory exists - Copyright (C) 1990, 1998 Free Software Foundation, Inc. + Copyright (C) 1990, 1998, 2004 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 @@ -21,14 +21,7 @@ #include #include - -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif - -#if !defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR) -#endif +#include "stat-macros.h" /* If PATH is an existing directory or symbolic link to a directory, return nonzero, else 0. */ diff --git a/lib/lchown.c b/lib/lchown.c index 9b99651eb..ec754eac8 100644 --- a/lib/lchown.c +++ b/lib/lchown.c @@ -26,18 +26,7 @@ extern int errno; #endif #include "lchown.h" - -#ifdef STAT_MACROS_BROKEN -# undef S_ISLNK -#endif - -#ifndef S_ISLNK -# ifdef S_IFLNK -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -# else -# define S_ISLNK(m) 0 -# endif -#endif +#include "stat-macros.h" /* Declare chown to avoid a warning. Don't include unistd.h, because it may have a conflicting prototype for lchown. */ diff --git a/lib/makepath.c b/lib/makepath.c index 422bcda82..ec9ea291c 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -1,6 +1,6 @@ /* makepath.c -- Ensure that a directory path exists. - Copyright (C) 1990, 1997, 1998, 1999, 2000, 2002, 2003 Free + Copyright (C) 1990, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -34,18 +34,6 @@ # include #endif -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif - -#if !defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif - -#ifndef S_IRWXUGO -# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) -#endif - #include #include @@ -56,31 +44,6 @@ extern int errno; #include -#ifndef S_ISUID -# define S_ISUID 04000 -#endif -#ifndef S_ISGID -# define S_ISGID 02000 -#endif -#ifndef S_ISVTX -# define S_ISVTX 01000 -#endif -#ifndef S_IRUSR -# define S_IRUSR 0200 -#endif -#ifndef S_IWUSR -# define S_IWUSR 0200 -#endif -#ifndef S_IXUSR -# define S_IXUSR 0100 -#endif - -#ifndef S_IRWXU -# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) -#endif - -#define WX_USR (S_IWUSR | S_IXUSR) - #include "gettext.h" #define _(msgid) gettext (msgid) @@ -88,6 +51,9 @@ extern int errno; #include "dirname.h" #include "error.h" #include "quote.h" +#include "stat-macros.h" + +#define WX_USR (S_IWUSR | S_IXUSR) #define CLEANUP_CWD \ do \ -- cgit v1.2.3-54-g00ecf