]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Remove all S_IS* and S_IF* definitions.
authorJim Meyering <jim@meyering.net>
Sat, 19 Jun 2004 12:26:53 +0000 (12:26 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 19 Jun 2004 12:26:53 +0000 (12:26 +0000)
Instead, just include "stat-macros.h".

lib/isdir.c
lib/lchown.c
lib/makepath.c

index 01cf8d5e4af280c4807eb06097e22120994a70ad..9f18b01bceaa74969fbb22d4ae1ccb83eee4770a 100644 (file)
@@ -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
 
 #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.  */
index 9b99651ebadf9fd162b2ab560a7854eebfafa39c..ec754eac89981b2bda0479e0cf837e9e95786cf9 100644 (file)
 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.  */
index 422bcda82ac5c27113e04d6570b4d753b6bfa150..ec9ea291c3b5ec4f70f1ccc9bdd13e5348b46995 100644 (file)
@@ -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
 # 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                                                   \