summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-06-19 12:26:53 +0000
committerJim Meyering <jim@meyering.net>2004-06-19 12:26:53 +0000
commit77e4428e58ebc910bc125c56c7a896e286163900 (patch)
treea7a1cd30e1ce98d98ff204f19976567ca42f4fb6
parent8836ff8b3ca95c312d0b8a69333575f246568e9e (diff)
downloadcoreutils-77e4428e58ebc910bc125c56c7a896e286163900.tar.xz
Remove all S_IS* and S_IF* definitions.
Instead, just include "stat-macros.h".
-rw-r--r--lib/isdir.c11
-rw-r--r--lib/lchown.c13
-rw-r--r--lib/makepath.c42
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 <sys/types.h>
#include <sys/stat.h>
-
-#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 <unistd.h>
#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 <stdlib.h>
#include <errno.h>
@@ -56,31 +44,6 @@ extern int errno;
#include <string.h>
-#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 \