]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Use #if, not #ifdef with HAVE_ macros.
authorJim Meyering <jim@meyering.net>
Sun, 15 Mar 1998 17:54:50 +0000 (17:54 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 15 Mar 1998 17:54:50 +0000 (17:54 +0000)
Use #if !, not #ifndef with HAVE_ macros.

src/chgrp.c
src/chown.c
src/copy.c
src/dd.c
src/dircolors.c
src/install.c
src/ls.c
src/mv.c
src/touch.c

index c4c701b76d877a9f9c622a469e8139065258fde7..3eb9ca213f2b1f52744b087d2fc4897b9b391e82 100644 (file)
 struct group *getgrnam ();
 #endif
 
-#ifndef HAVE_ENDGRENT
+#if ! HAVE_ENDGRENT
 # define endgrent() ((void) 0)
 #endif
 
-#ifdef HAVE_LCHOWN
+#if HAVE_LCHOWN
 # define LCHOWN(FILE, OWNER, GROUP) lchown (FILE, OWNER, GROUP)
 #else
 # define LCHOWN(FILE, OWNER, GROUP) 1
@@ -379,7 +379,7 @@ main (int argc, char **argv)
       usage (1);
     }
 
-#ifndef HAVE_LCHOWN
+#if ! HAVE_LCHOWN
   if (change_symlinks)
     {
       error (1, 0, _("--no-dereference (-h) is not supported on this system"));
index 9fec27aeff404abf1536841487d14916553aeaac..57e6f38401535aaa4e0234b5b9ca0b9258f78bf9 100644 (file)
@@ -46,11 +46,11 @@ struct group *getgrnam ();
 struct group *getgrgid ();
 #endif
 
-#ifndef HAVE_ENDPWENT
+#if ! HAVE_ENDPWENT
 # define endpwent() ((void) 0)
 #endif
 
-#ifdef HAVE_LCHOWN
+#if HAVE_LCHOWN
 # define LCHOWN(FILE, OWNER, GROUP) lchown (FILE, OWNER, GROUP)
 #else
 # define LCHOWN(FILE, OWNER, GROUP) 1
@@ -356,7 +356,7 @@ main (int argc, char **argv)
       usage (1);
     }
 
-#ifndef HAVE_LCHOWN
+#if ! HAVE_LCHOWN
   if (change_symlinks)
     {
       error (1, 0, _("--no-dereference (-h) is not supported on this system"));
index c98923a88f341f02b7711627be4706468f75a1aa..70bd560823c8042dd8d15035eb42bbab639547e6 100644 (file)
@@ -170,7 +170,7 @@ copy_reg (const char *src_path, const char *dst_path,
 
   buf_size = ST_BLKSIZE (sb);
 
-#ifdef HAVE_ST_BLOCKS
+#if HAVE_ST_BLOCKS
   if (sparse_mode == SPARSE_AUTO && S_ISREG (sb.st_mode))
     {
       /* Use a heuristic to determine whether SRC_PATH contains any
@@ -267,7 +267,7 @@ copy_reg (const char *src_path, const char *dst_path,
 
   if (last_write_made_hole)
     {
-#ifdef HAVE_FTRUNCATE
+#if HAVE_FTRUNCATE
       /* Write a null character and truncate it again.  */
       if (full_write (dest_desc, "", 1) < 0
          || ftruncate (dest_desc, n_read_total) < 0)
@@ -659,7 +659,7 @@ copy_internal (const char *src_path, const char *dst_path,
        {
          /* Preserve the owner and group of the just-`copied'
             symbolic link, if possible.  */
-# ifdef HAVE_LCHOWN
+# if HAVE_LCHOWN
          if (DO_CHOWN (lchown, dst_path, src_sb.st_uid, src_sb.st_gid))
            {
              error (0, errno, _("preserving ownership for %s"), dst_path);
index 538d74008450fb3891c81e08d72ca499c58c277b..276dce1b9a4df498123e6ac43c3416cb90cd373e 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -1106,7 +1106,7 @@ main (int argc, char **argv)
       output_fd = open (output_file, omode, 0666);
       if (output_fd < 0)
        error (1, errno, "%s", output_file);
-#ifdef HAVE_FTRUNCATE
+#if HAVE_FTRUNCATE
       if (seek_record != 0 && !(conversions_mask & C_NOTRUNC))
        {
          off_t o = seek_record * output_blocksize;
index b16d7e27ab85a95b2f7cc006128a5a8d5d2939ca..336c0580c31d8750a59e29889bca842eed19980c 100644 (file)
@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
 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
+#if HAVE_CONFIG_H
 # include <config.h>
 #endif
 
index 4d9c4374c8de1145585807632c2614f6ba489e64..c36fd1b9e6e53b4779112b053228eb46c7993eee 100644 (file)
@@ -95,11 +95,11 @@ uid_t getuid ();
 gid_t getgid ();
 #endif
 
-#ifndef HAVE_ENDGRENT
+#if ! HAVE_ENDGRENT
 # define endgrent() ((void) 0)
 #endif
 
-#ifndef HAVE_ENDPWENT
+#if ! HAVE_ENDPWENT
 # define endpwent() ((void) 0)
 #endif
 
index 971be77c22f7bdeb6e3dd0bea4d5f5c49307f869..b154e84144060c361934df8dc571120b9faccc79 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -47,7 +47,7 @@
 # include <inttypes.h>
 #endif
 
-#ifdef HAVE_TERMIOS_H
+#if HAVE_TERMIOS_H
 # include <termios.h>
 #endif
 
@@ -2167,7 +2167,7 @@ print_long_format (const struct fileinfo *f)
   const char *fmt;
   char *user_name;
 
-#ifdef HAVE_ST_DM_MODE
+#if HAVE_ST_DM_MODE
   mode_string (f->stat.st_dm_mode, modebuf);
 #else
   mode_string (f->stat.st_mode, modebuf);
index e9d94a910e786a11a1ce24307350dad0485b0398..07da4fadca37066c99b73391864022ce647573f3 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -60,7 +60,7 @@
 #include "remove.h"
 #include "error.h"
 
-#ifdef HAVE_LCHOWN
+#if HAVE_LCHOWN
 # define chown(PATH, OWNER, GROUP) lchown(PATH, OWNER, GROUP)
 #endif
 
index 41decd08af023d63600a81fc684ab532e5a9c1dd..7f90b5f5224a2eb1331169462ebe86a8b3e25a6b 100644 (file)
@@ -52,7 +52,7 @@ int safe_read ();
 int full_write ();
 void invalid_arg ();
 
-#ifndef HAVE_UTIME_NULL
+#if ! HAVE_UTIME_NULL
 static int utime_now ();
 #endif
 
@@ -171,7 +171,7 @@ touch (char *file)
 
   if (amtime_now)
     {
-#ifndef HAVE_UTIME_NULL
+#if ! HAVE_UTIME_NULL
       status = utime_now (file, sbuf.st_size);
 #else
       /* Pass NULL to utime so it will not fail if we just have
@@ -209,7 +209,7 @@ touch (char *file)
   return 0;
 }
 
-#ifndef HAVE_UTIME_NULL
+#if ! HAVE_UTIME_NULL
 /* Emulate utime (file, NULL) for systems (like 4.3BSD) that do not
    interpret it to set the access and modification times of FILE to
    the current time.  FILESIZE is the correct size of FILE, used to