diff options
author | Jim Meyering <jim@meyering.net> | 1994-10-02 02:09:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1994-10-02 02:09:38 +0000 |
commit | f17c045d219e48e96f7a35d37f239627fa0f8fcf (patch) | |
tree | c1cc2f8565c315aebefda2e283632a00595fa4d0 /src | |
parent | b055972c6b12e52f0e41a47d47b711e10b530c1b (diff) | |
download | coreutils-f17c045d219e48e96f7a35d37f239627fa0f8fcf.tar.xz |
.
Diffstat (limited to 'src')
-rw-r--r-- | src/chgrp.c | 12 | ||||
-rw-r--r-- | src/chmod.c | 10 | ||||
-rw-r--r-- | src/chown.c | 10 | ||||
-rw-r--r-- | src/cp-hash.c | 10 | ||||
-rw-r--r-- | src/cp.c | 10 | ||||
-rw-r--r-- | src/dd.c | 10 | ||||
-rw-r--r-- | src/df.c | 10 | ||||
-rw-r--r-- | src/du.c | 10 | ||||
-rw-r--r-- | src/install.c | 10 | ||||
-rw-r--r-- | src/ln.c | 10 | ||||
-rw-r--r-- | src/ls.c | 20 | ||||
-rw-r--r-- | src/mkdir.c | 10 | ||||
-rw-r--r-- | src/mkfifo.c | 10 | ||||
-rw-r--r-- | src/mknod.c | 10 | ||||
-rw-r--r-- | src/mv.c | 10 | ||||
-rw-r--r-- | src/rm.c | 17 | ||||
-rw-r--r-- | src/rmdir.c | 10 | ||||
-rw-r--r-- | src/sync.c | 10 | ||||
-rw-r--r-- | src/system.h | 51 | ||||
-rw-r--r-- | src/touch.c | 10 |
20 files changed, 39 insertions, 221 deletions
diff --git a/src/chgrp.c b/src/chgrp.c index a7d952be6..84e6b4fc8 100644 --- a/src/chgrp.c +++ b/src/chgrp.c @@ -17,17 +17,7 @@ /* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <ctype.h> #include <sys/types.h> @@ -48,7 +38,7 @@ struct group *getgrnam (); #endif -#ifdef _POSIX_SOURCE +#ifdef _POSIX_VERSION #define endgrent() #endif diff --git a/src/chmod.c b/src/chmod.c index c2d1c879a..6a0ebb74c 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -23,17 +23,7 @@ David MacKenzie <djm@gnu.ai.mit.edu> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> diff --git a/src/chown.c b/src/chown.c index 9d5a424e3..b6e203177 100644 --- a/src/chown.c +++ b/src/chown.c @@ -28,17 +28,7 @@ Written by David MacKenzie <djm@gnu.ai.mit.edu>. */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <ctype.h> #include <sys/types.h> diff --git a/src/cp-hash.c b/src/cp-hash.c index 5204d1368..92c55a130 100644 --- a/src/cp-hash.c +++ b/src/cp-hash.c @@ -17,17 +17,7 @@ Written by Torbjorn Granlund, Sweden (tege@sics.se). */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include "cp.h" #include "safe-stat.h" @@ -21,17 +21,7 @@ #pragma alloca #endif -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include "cp.h" @@ -53,17 +53,7 @@ sync Pad every input block to size of ibs with trailing NULs. */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <ctype.h> @@ -33,17 +33,7 @@ Written by David MacKenzie <djm@gnu.ai.mit.edu> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <sys/types.h> #include <getopt.h> @@ -40,17 +40,7 @@ #pragma alloca #endif -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> diff --git a/src/install.c b/src/install.c index ad5aef395..fc880e03e 100644 --- a/src/install.c +++ b/src/install.c @@ -52,17 +52,7 @@ David MacKenzie <djm@gnu.ai.mit.edu> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <ctype.h> @@ -21,17 +21,7 @@ #pragma alloca #endif -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <sys/types.h> #include <getopt.h> @@ -36,17 +36,7 @@ #pragma alloca #endif -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <sys/types.h> #if !defined(_POSIX_SOURCE) || defined(_AIX) #include <sys/ioctl.h> @@ -58,17 +48,25 @@ #include "system.h" #include <fnmatch.h> +#if HAVE_LIMITS_H +#include <limits.h> +#endif + #include "ls.h" #include "version.h" #include "safe-stat.h" #include "safe-lstat.h" +#ifndef INT_MAX +#define INT_MAX (((unsigned int) ~(unsigned int) 0) >> 1) +#endif + #ifndef S_IEXEC #define S_IEXEC S_IXUSR #endif /* Return an int indicating the result of comparing two longs. */ -#if SIZEOF_INT == 2 +#if (INT_MAX <= 65535) #define longdiff(a, b) ((a) < (b) ? -1 : (a) > (b) ? 1 : 0) #else #define longdiff(a, b) ((a) - (b)) diff --git a/src/mkdir.c b/src/mkdir.c index 234d34f55..5a6030490 100644 --- a/src/mkdir.c +++ b/src/mkdir.c @@ -27,17 +27,7 @@ David MacKenzie <djm@ai.mit.edu> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> diff --git a/src/mkfifo.c b/src/mkfifo.c index 4977d58ac..0c9972334 100644 --- a/src/mkfifo.c +++ b/src/mkfifo.c @@ -22,17 +22,7 @@ David MacKenzie <djm@ai.mit.edu> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> diff --git a/src/mknod.c b/src/mknod.c index d92754c55..957e11a74 100644 --- a/src/mknod.c +++ b/src/mknod.c @@ -27,17 +27,7 @@ David MacKenzie <djm@ai.mit.edu> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> @@ -41,17 +41,7 @@ #pragma alloca #endif -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> @@ -17,17 +17,7 @@ /* Written by Paul Rubin, David MacKenzie, and Richard Stallman. */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> @@ -35,12 +25,11 @@ #include "version.h" #include "safe-lstat.h" -#ifdef _POSIX_SOURCE +#ifdef D_INO_IN_DIRENT +#define D_INO(dp) ((dp)->d_ino) +#else /* POSIX.1 doesn't have inodes, so fake them to avoid lots of ifdefs. */ -#define ino_t unsigned long #define D_INO(dp) 1 -#else -#define D_INO(dp) ((dp)->d_ino) #endif char *basename (); diff --git a/src/rmdir.c b/src/rmdir.c index c863973f7..ba8c15d3b 100644 --- a/src/rmdir.c +++ b/src/rmdir.c @@ -22,17 +22,7 @@ David MacKenzie <djm@ai.mit.edu> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> diff --git a/src/sync.c b/src/sync.c index 1d44443ee..04daa3c13 100644 --- a/src/sync.c +++ b/src/sync.c @@ -17,17 +17,7 @@ /* Jim Meyering <meyering@comco.com> */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include "system.h" diff --git a/src/system.h b/src/system.h index 7c49788d1..95bf9945c 100644 --- a/src/system.h +++ b/src/system.h @@ -1,5 +1,5 @@ /* system-dependent definitions for fileutils programs. - Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. + Copyright (C) 89, 91, 92, 93, 1994 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 @@ -32,8 +32,8 @@ #undef S_ISSOCK #endif /* STAT_MACROS_BROKEN. */ -#ifndef S_ISREG /* Doesn't have POSIX.1 stat stuff. */ -#define mode_t unsigned short +#ifndef S_IFMT +#define S_IFMT 0170000 #endif #if !defined(S_ISBLK) && defined(S_IFBLK) #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) @@ -67,7 +67,7 @@ #define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) #endif -#ifndef _POSIX_SOURCE +#ifdef HAVE_SYS_PARAM_H #include <sys/param.h> #endif @@ -91,6 +91,7 @@ #include "pathmax.h" +/* FIXME: Don't use _POSIX_VERSION. */ #ifndef _POSIX_VERSION off_t lseek (); #endif @@ -121,15 +122,15 @@ off_t lseek (); #endif #undef HAVE_MAJOR -#ifdef _POSIX_VERSION +#ifdef HAVE_UTIME_H #include <utime.h> -#else /* not _POSIX_VERSION */ +#else struct utimbuf { long actime; long modtime; }; -#endif /* _POSIX_VERSION */ +#endif #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include <string.h> @@ -159,7 +160,7 @@ char *getenv (); extern int errno; #endif /* STDC_HEADERS */ -#if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION) +#ifdef HAVE_FCNTL_H #include <fcntl.h> #else #include <sys/file.h> @@ -177,24 +178,24 @@ extern int errno; #define R_OK 4 #endif -#if defined(DIRENT) || defined(_POSIX_VERSION) -#include <dirent.h> -#define NLENGTH(direct) (strlen((direct)->d_name)) -#else /* not (DIRENT or _POSIX_VERSION) */ -#define dirent direct -#define NLENGTH(direct) ((direct)->d_namlen) -#ifdef SYSNDIR -#include <sys/ndir.h> -#endif /* SYSNDIR */ -#ifdef SYSDIR -#include <sys/dir.h> -#endif /* SYSDIR */ -#ifdef NDIR -#include <ndir.h> -#endif /* NDIR */ -#endif /* DIRENT or _POSIX_VERSION */ +#ifdef HAVE_DIRENT_H +# include <dirent.h> +# define NLENGTH(direct) (strlen((direct)->d_name)) +#else /* not HAVE_DIRENT_H */ +# define dirent direct +# define NLENGTH(direct) ((direct)->d_namlen) +# ifdef HAVE_SYS_NDIR_H +# include <sys/ndir.h> +# endif /* HAVE_SYS_NDIR_H */ +# ifdef HAVE_SYS_DIR_H +# include <sys/dir.h> +# endif /* HAVE_SYS_DIR_H */ +# ifdef HAVE_NDIR_H +# include <ndir.h> +# endif /* HAVE_NDIR_H */ +#endif /* HAVE_DIRENT_H */ -#ifdef VOID_CLOSEDIR +#ifdef CLOSEDIR_VOID /* Fake a return value. */ #define CLOSEDIR(d) (closedir (d), 0) #else diff --git a/src/touch.c b/src/touch.c index feadcc713..94bc914b4 100644 --- a/src/touch.c +++ b/src/touch.c @@ -32,17 +32,7 @@ Written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith. */ -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include <config.h> -#else -#include "config.h" -#endif -#endif - #include <stdio.h> #include <ctype.h> #include <getopt.h> |