From: Jim Meyering Date: Sun, 15 Mar 1998 17:54:50 +0000 (+0000) Subject: Use #if, not #ifdef with HAVE_ macros. X-Git-Tag: FILEUTILS-3_16n~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6684ffa826953b473fe8d7b93770905d081dda74;p=thirdparty%2Fcoreutils.git Use #if, not #ifdef with HAVE_ macros. Use #if !, not #ifndef with HAVE_ macros. --- diff --git a/src/chgrp.c b/src/chgrp.c index c4c701b76d..3eb9ca213f 100644 --- a/src/chgrp.c +++ b/src/chgrp.c @@ -39,11 +39,11 @@ 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")); diff --git a/src/chown.c b/src/chown.c index 9fec27aeff..57e6f38401 100644 --- a/src/chown.c +++ b/src/chown.c @@ -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")); diff --git a/src/copy.c b/src/copy.c index c98923a88f..70bd560823 100644 --- a/src/copy.c +++ b/src/copy.c @@ -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); diff --git a/src/dd.c b/src/dd.c index 538d740084..276dce1b9a 100644 --- 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; diff --git a/src/dircolors.c b/src/dircolors.c index b16d7e27ab..336c0580c3 100644 --- a/src/dircolors.c +++ b/src/dircolors.c @@ -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 #endif diff --git a/src/install.c b/src/install.c index 4d9c4374c8..c36fd1b9e6 100644 --- a/src/install.c +++ b/src/install.c @@ -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 diff --git a/src/ls.c b/src/ls.c index 971be77c22..b154e84144 100644 --- a/src/ls.c +++ b/src/ls.c @@ -47,7 +47,7 @@ # include #endif -#ifdef HAVE_TERMIOS_H +#if HAVE_TERMIOS_H # include #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); diff --git a/src/mv.c b/src/mv.c index e9d94a910e..07da4fadca 100644 --- 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 diff --git a/src/touch.c b/src/touch.c index 41decd08af..7f90b5f522 100644 --- a/src/touch.c +++ b/src/touch.c @@ -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