]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
.
authorJim Meyering <jim@meyering.net>
Sun, 2 Oct 1994 02:09:38 +0000 (02:09 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 2 Oct 1994 02:09:38 +0000 (02:09 +0000)
24 files changed:
lib/Makefile.in
lib/backupfile.c
lib/mkdir.c
lib/savedir.c
src/chgrp.c
src/chmod.c
src/chown.c
src/cp-hash.c
src/cp.c
src/dd.c
src/df.c
src/du.c
src/install.c
src/ln.c
src/ls.c
src/mkdir.c
src/mkfifo.c
src/mknod.c
src/mv.c
src/rm.c
src/rmdir.c
src/sync.c
src/system.h
src/touch.c

index 5737aa4ef430b95c4f52736f8bc79143c4792f8d..b84df8b5fc638eb96caac3ca0ad457e4dae71cde 100644 (file)
@@ -23,14 +23,12 @@ VPATH = @srcdir@
 CC = @CC@
 AR = ar
 RANLIB = @RANLIB@
-DEFS = -DCONFIG_BROKETS -Dlint @DEFS@
+DEFS = -Dlint @DEFS@
 CFLAGS = @CFLAGS@
 YACC = @YACC@
 
-prefix = @prefix@
-exec_prefix = $(prefix)
+exec_prefix = @exec_prefix@
 libdir = $(exec_prefix)/lib
-
 SOURCES = getdate.y posixtm.y \
 argmatch.c backupfile.c basename.c dirname.c eaccess.c \
 error.c filemode.c fsusage.c full-write.c getopt.c getopt1.c \
@@ -49,19 +47,21 @@ stripslash.o xgetcwd.o xmalloc.o xstrdup.o userspec.o yesno.o \
 @LIBOBJS@ @ALLOCA@
 
 DISTFILES = Makefile.in backupfile.h getopt.h modechange.h \
-fnmatch.h fsusage.h mountlist.h pathmax.h safe-xstat.c.in safe-xstat.h.in \
+fnmatch.h fsusage.h mountlist.h pathmax.h safe-xstat.cin safe-xstat.hin \
 getdate.c posixtm.c $(SOURCES)
 
 all: libfu.a
 
-.SUFFIXES =
-.SUFFIXES = .c .o
+.SUFFIXES:
+.SUFFIXES: .c .o
 
 .c.o:
        $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I.. -I$(srcdir) $(CFLAGS) $<
 
 Makefile: ../config.status Makefile.in
-       CONFIG_FILES=$@ CONFIG_HEADERS= ../config.status
+       cd ..; CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+
+installdirs:
 
 install: all
 
@@ -78,12 +78,13 @@ clean:
 mostlyclean: clean
 
 distclean: clean
-       rm -f Makefile *.tab.c getdate.c *posixtm.c
+       rm -f Makefile *.tab.c getdate.c *posixtm.c \
+         safe-stat.c safe-stat.h safe-lstat.c safe-lstat.h
 
 realclean: distclean
-       rm -f TAGS safe-stat.c safe-stat.h safe-lstat.c safe-lstat.h 
+       rm -f TAGS
 
-distdir = ../`cat ../.fname`/lib 
+distdir = ../`cat ../distname`/$(subdir)
 dist: $(DISTFILES)
        for file in $(DISTFILES); do \
          ln $$file $(distdir) \
@@ -98,21 +99,21 @@ libfu.a: $(OBJECTS)
 extract_stat = sed -e 's/@l@//g' -e 's/@L@//g'
 extract_lstat = sed -e 's/@l@/l/g' -e 's/@L@/L/g'
 
-safe-lstat.c: safe-xstat.c.in
-       $(extract_lstat) $(srcdir)/safe-xstat.c.in > $@-tmp
-       mv $@-tmp $@
+safe-lstat.c: safe-xstat.cin
+       $(extract_lstat) $(srcdir)/safe-xstat.cin > $@-t
+       mv $@-t $@
 
-safe-lstat.h: safe-xstat.h.in
-       $(extract_lstat) $(srcdir)/safe-xstat.h.in > $@-tmp
-       mv $@-tmp $@
+safe-lstat.h: safe-xstat.hin
+       $(extract_lstat) $(srcdir)/safe-xstat.hin > $@-t
+       mv $@-t $@
 
-safe-stat.c: safe-xstat.c.in
-       $(extract_stat) $(srcdir)/safe-xstat.c.in > $@-tmp
-       mv $@-tmp $@
+safe-stat.c: safe-xstat.cin
+       $(extract_stat) $(srcdir)/safe-xstat.cin > $@-t
+       mv $@-t $@
 
-safe-stat.h: safe-xstat.h.in
-       $(extract_stat) $(srcdir)/safe-xstat.h.in > $@-tmp
-       mv $@-tmp $@
+safe-stat.h: safe-xstat.hin
+       $(extract_stat) $(srcdir)/safe-xstat.hin > $@-t
+       mv $@-t $@
 
 safe-stat.o: safe-stat.h
 safe-lstat.o: safe-lstat.h
index 2ef0f0b48d154bcaf0933327d7af8a4237a1e808..36094af5edeec6ab976bf8300fac96dc81808299 100644 (file)
 #include <strings.h>
 #endif
 
-#ifdef DIRENT
+#ifdef HAVE_DIRENT_H
 #include <dirent.h>
 #define NLENGTH(direct) (strlen((direct)->d_name))
-#else /* not DIRENT */
+#else /* not HAVE_DIRENT_H */
 #define dirent direct
 #define NLENGTH(direct) ((direct)->d_namlen)
-#ifdef SYSNDIR
+#ifdef HAVE_SYS_NDIR_H
 #include <sys/ndir.h>
-#endif /* SYSNDIR */
-#ifdef SYSDIR
+#endif /* HAVE_SYS_NDIR_H */
+#ifdef HAVE_SYS_DIR_H
 #include <sys/dir.h>
-#endif /* SYSDIR */
-#ifdef NDIR
+#endif /* HAVE_SYS_DIR_H */
+#ifdef HAVE_NDIR_H
 #include <ndir.h>
-#endif /* NDIR */
-#endif /* DIRENT */
+#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
index b1eb47333cbd5a17448325c2bc5ef988045647b2..3726cbbcc1a7a94ca401502c50f2012226064ae7 100644 (file)
@@ -1,4 +1,4 @@
-/* mkdir.c -- BSD compatible directory functions for System V
+/* mkdir.c -- BSD compatible make directory function for System V
    Copyright (C) 1988, 1990 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
 
 #include <sys/types.h>
 #include <sys/stat.h>
+
 #include <errno.h>
-#ifndef STDC_HEADERS
+#ifndef errno
 extern int errno;
 #endif
 
 #ifdef STAT_MACROS_BROKEN
 #undef S_ISDIR
-#endif /* STAT_MACROS_BROKEN.  */
+#endif
 
 #if !defined(S_ISDIR) && defined(S_IFDIR)
 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
@@ -43,7 +44,7 @@ extern int errno;
 
 #include "safe-stat.h"
 
-/* mkdir and rmdir adapted from GNU tar.  */
+/* mkdir adapted from GNU tar.  */
 
 /* Make directory DPATH, with permission mode DMODE.
 
@@ -66,7 +67,7 @@ mkdir (dpath, dmode)
 
   if (SAFE_STAT (dpath, &statbuf) == 0)
     {
-      errno = EEXIST;          /* stat worked, so it already exists.  */
+      errno = EEXIST;          /* stat worked, it already exists */
       return -1;
     }
 
@@ -77,70 +78,36 @@ mkdir (dpath, dmode)
   cpid = fork ();
   switch (cpid)
     {
-    case -1:                   /* Cannot fork.  */
-      return -1;               /* errno is set already.  */
+    case -1:                   /* cannot fork */
+      return -1;               /* errno already set */
+
+    case 0:                    /* child process */
 
-    case 0:                    /* Child process.  */
       /* Cheap hack to set mode of new directory.  Since this child
-        process is going away anyway, we zap its umask.
-        This won't suffice to set SUID, SGID, etc. on this
-        directory, so the parent process calls chmod afterward.  */
-      status = umask (0);      /* Get current umask.  */
-      umask (status | (0777 & ~dmode));        /* Set for mkdir.  */
+        process is going away anyway, we zap its umask.  This won't
+        suffice to set SUID, SGID, etc. on this directory, so the parent
+        process calls chmod afterward.  */
+
+      status = umask (0);
+      umask (status | (0777 & ~dmode));
       execl ("/bin/mkdir", "mkdir", dpath, (char *) 0);
       _exit (1);
 
-    default:                   /* Parent process.  */
-      while (wait (&status) != cpid) /* Wait for kid to finish.  */
-       /* Do nothing.  */ ;
+    default:                   /* parent process */
 
-      if (status & 0xFFFF)
-       {
-         errno = EIO;          /* /bin/mkdir failed.  */
-         return -1;
-       }
-      return chmod (dpath, dmode);
-    }
-}
-
-/* Remove directory DPATH.
-   Return 0 if successful, -1 if not.  */
+      /* Wait for kid to finish.  */
 
-int
-rmdir (dpath)
-     char *dpath;
-{
-  int cpid, status;
-  struct stat statbuf;
-
-  if (SAFE_STAT (dpath, &statbuf) != 0)
-    return -1;                 /* stat set errno.  */
-
-  if (!S_ISDIR (statbuf.st_mode))
-    {
-      errno = ENOTDIR;
-      return -1;
-    }
-
-  cpid = fork ();
-  switch (cpid)
-    {
-    case -1:                   /* Cannot fork.  */
-      return -1;               /* errno is set already.  */
-
-    case 0:                    /* Child process.  */
-      execl ("/bin/rmdir", "rmdir", dpath, (char *) 0);
-      _exit (1);
-
-    default:                   /* Parent process.  */
-      while (wait (&status) != cpid) /* Wait for kid to finish.  */
+      while (wait (&status) != cpid)
        /* Do nothing.  */ ;
 
       if (status & 0xFFFF)
        {
-         errno = EIO;          /* /bin/rmdir failed.  */
+
+         /* /bin/mkdir failed.  */
+
+         errno = EIO;
          return -1;
        }
-      return 0;
+      return chmod (dpath, dmode);
     }
 }
index b831c1fe92a215c3ed89b2e69b984aa9b2ea78e5..cdf1288a3e6706185f43c1d027e246bd8098efae 100644 (file)
 #include <unistd.h>
 #endif
 
-#ifdef DIRENT
+#ifdef HAVE_DIRENT_H
 #include <dirent.h>
 #define NLENGTH(direct) (strlen((direct)->d_name))
-#else /* not DIRENT */
+#else /* not HAVE_DIRENT_H */
 #define dirent direct
 #define NLENGTH(direct) ((direct)->d_namlen)
-#ifdef SYSNDIR
+#ifdef HAVE_SYS_NDIR_H
 #include <sys/ndir.h>
-#endif /* SYSNDIR */
-#ifdef SYSDIR
+#endif /* HAVE_SYS_NDIR_H */
+#ifdef HAVE_SYS_DIR_H
 #include <sys/dir.h>
-#endif /* SYSDIR */
-#ifdef NDIR
+#endif /* HAVE_SYS_DIR_H */
+#ifdef HAVE_NDIR_H
 #include <ndir.h>
-#endif /* NDIR */
-#endif /* DIRENT */
+#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
index a7d952be62551e22d351ecb158b8f72233312040..84e6b4fc8ca5b319c5728d445c3d011ae8b040c3 100644 (file)
 
 /* 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
 
index c2d1c879aff1d6fea403461c72354a898bee437e..6a0ebb74c23446ba58ccaabdb80137f1348fa9a5 100644 (file)
 
    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>
index 9d5a424e35cdf2696e75282666cc364d758ade7a..b6e2031778aa5eb0d67d399840bb56cf1c95742e 100644 (file)
 
    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>
index 5204d1368235ffa76d066379763311bd8b95c760..92c55a130e63bde8862a8be748d0a04a3a4f3ebb 100644 (file)
 
    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"
index fbbc4fd8cc85f33a256a624347a734c2ae0bf2ac..3ba38f5aacd3aadf8488a3f387ef79865c570fe6 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
  #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"
index 881af94e4339631e83ce73e2d1eae8817839c936..5d8aa6e6eafe8f46ed4116ffb5893b07cf0efb47 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
    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>
 
index c1457bc35f86454f6881cd5b041e84722c5f5b0f..23be53140fa9b2dc8d5ad670e47ecbef9a79795c 100644 (file)
--- a/src/df.c
+++ b/src/df.c
 
    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>
index 0a2a1651540bab9606ef1a99abdcb28da069ca77..ad22be0ea995eed31fadb2d35c5bcfd95ef74448 100644 (file)
--- a/src/du.c
+++ b/src/du.c
  #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>
index ad5aef3955e498c83db36ff65a4e4fe471ac564d..fc880e03ee0fd7e404769fe7c6cbd0b12afe6dd9 100644 (file)
 
    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>
index 4a9c362ce0017c1c8013a458a444ce106ba3f279..41227980a93d47246c10d0be1c43e8dc45fa8a47 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
  #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>
index da0c1d66e0c9db984aa139706324490451d04194..551871c78a3538e8283dc2901507d5ae38676c29 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
  #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>
 #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))
index 234d34f55d53e7b4e759dfc1c9bc079ce57503d7..5a60304904a5b00c8b9ff48a65a3f58123226390 100644 (file)
 
    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>
index 4977d58accc9672fd7d25a403f65096179caf48a..0c997233493c5cf8f724670852008e2232cabc4e 100644 (file)
 
    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>
index d92754c5582a302aaeb9795f3cb82ea3a9271ec4..957e11a74f2af24dd78bf220c341513a6f76e228 100644 (file)
 
    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>
index 1b6664557f08fa4623e58c5872c3c3953337f352..0c2ddde1017d43592a62924cd8f7c9671ee735c6 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
  #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>
index 438e8fa426dc20b40b57c5f761eea276c89c392f..5ff703cba08fd32d07320b1af70c82647c9071fc 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
 
 /* 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>
 #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 ();
index c863973f7c639a2b44ac14113f1fd1d939f56a9e..ba8c15d3bfb0d7e3570cc3da9c83fbfde80cfdd3 100644 (file)
 
    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>
index 1d44443eeb349bc2b20714766f431208ffe78a35..04daa3c13ed0966a3c00b2f0e90503656906b581 100644 (file)
 
 /* 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"
index 7c49788d1252eb3c410b645219b2f9b365b58591..95bf9945c399e11fcf8800cdfab40ef0acb8ed59 100644 (file)
@@ -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
index feadcc71353eb6a85b7323745ca47bbe65dcdaa9..94bc914b4f0a6e584b659b572675e9438e9633c1 100644 (file)
    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>