]> Dogcows Code - chaz/tar/commitdiff
*** empty log message ***
authorFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:49:16 +0000 (02:49 +0000)
committerFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:49:16 +0000 (02:49 +0000)
scripts/level-1
src/gnu.c
src/port.h

index 49545ae10a057717a40fa0a9990e682b906005e2..55786950be2c9aa3e1808838cf41c8b620bbbb0a 100644 (file)
@@ -65,9 +65,10 @@ startdate="`date`"
 here="`pwd`"
 
 # Logfile name should be in the form  ``log-1993-03-18-level-1''
+# They go in the subdirectory `log' of the current directory. 
 # i.e. year-month-date.  This format is useful for sorting by name, since
 # logfiles are intentionally kept online for future reference.
-LOGFILE="log-`date | sed -ne '
+LOGFILE="log/log-`date | sed -ne '
    s/[^ ]*  *\([^ ]*\)  *\([^ ]*\).* \([^ ]*\)$/\3-\1-\2/
    /-[0-9]$/s/\([0-9]\)$/0\1/
    /Jan/{s/Jan/01/p;q;}
index 7606c0ad81ba00675c858c5af5a2c5e11ebcc269..a360212b7171d9c8e06956b80952877451e18089 100644 (file)
--- a/src/gnu.c
+++ b/src/gnu.c
@@ -30,28 +30,6 @@ time_t time ();
 #include "tar.h"
 #include "port.h"
 
-#if defined(_POSIX_VERSION) || defined(DIRENT)
-#include <dirent.h>
-#ifdef direct
-#undef direct
-#endif /* direct */
-#define direct dirent
-#define DP_NAMELEN(x) strlen((x)->d_name)
-#endif /* _POSIX_VERSION or DIRENT */
-#if !defined(_POSIX_VERSION) && !defined(DIRENT) && defined(BSD42)
-#include <sys/dir.h>
-#define DP_NAMELEN(x)  (x)->d_namlen
-#endif /* not _POSIX_VERSION and BSD42 */
-#ifdef __MSDOS__
-#include "msd_dir.h"
-#define DP_NAMELEN(x)  (x)->d_namlen
-#define direct dirent
-#endif
-#if defined(USG) && !defined(_POSIX_VERSION) && !defined(DIRENT)
-#include <ndir.h>
-#define DP_NAMELEN(x) strlen((x)->d_name)
-#endif /* USG and not _POSIX_VERSION and not DIRENT */
-
 #ifndef S_ISLNK
 #define lstat stat
 #endif
@@ -127,7 +105,7 @@ read_dir_file ()
   time (&this_time);
   if (gnu_dumpfile[0] != '/')
     {
-#if defined(__MSDOS__) || defined(USG) || defined(_POSIX_VERSION)
+#if defined(__MSDOS__) || defined(HAVE_GETCWD) || defined(_POSIX_VERSION)
       if (!getcwd (path, PATH_MAX))
        {
          msg ("Couldn't get current directory.");
@@ -323,7 +301,7 @@ get_dir_contents (p, device)
      int device;
 {
   DIR *dirp;
-  register struct direct *d;
+  register struct dirent *d;
   char *new_buf;
   char *namebuf;
   int bufsiz;
@@ -369,7 +347,7 @@ get_dir_contents (p, device)
          /* Skip . and .. */
          if (is_dot_or_dotdot (d->d_name))
            continue;
-         if (DP_NAMELEN (d) + len >= bufsiz)
+         if (NLENGTH (d) + len >= bufsiz)
            {
              bufsiz += NAMSIZ;
              namebuf = ck_realloc (namebuf, bufsiz + 2);
@@ -433,7 +411,7 @@ get_dir_contents (p, device)
            add_buffer (the_buffer, "N", 1);
          else
            add_buffer (the_buffer, "Y", 1);
-         add_buffer (the_buffer, d->d_name, (int) (DP_NAMELEN (d) + 1));
+         add_buffer (the_buffer, d->d_name, (int) (NLENGTH (d) + 1));
        }
       add_buffer (the_buffer, "\000\000", 2);
       closedir (dirp);
@@ -570,7 +548,7 @@ gnu_restore (skipcrud)
   PTR the_buffer;
   char *p;
   DIR *dirp;
-  struct direct *d;
+  struct dirent *d;
   char *cur, *arc;
   extern struct stat hstat;    /* Stat struct corresponding */
   long size, copied;
@@ -594,7 +572,7 @@ gnu_restore (skipcrud)
       if (is_dot_or_dotdot (d->d_name))
        continue;
 
-      add_buffer (the_buffer, d->d_name, (int) (DP_NAMELEN (d) + 1));
+      add_buffer (the_buffer, d->d_name, (int) (NLENGTH (d) + 1));
     }
   closedir (dirp);
   add_buffer (the_buffer, "", 1);
@@ -660,7 +638,7 @@ recursively_delete (path)
 {
   struct stat sbuf;
   DIR *dirp;
-  struct direct *dp;
+  struct dirent *dp;
   char *path_buf;
   /* int path_len; */
 
index 4bf9d2c6b95eb7c06c5e6f896c5cf8658284c87e..b57ba0ff5bb19ecfa593ec82bfa6307408b062af 100644 (file)
@@ -25,7 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <alloca.h>
 #else /* not HAVE_ALLOCA_H */
 #ifdef _AIX
- #pragma alloca
+#pragma alloca
 #else /* not _AIX */
 char *alloca ();
 #endif /* not _AIX */
@@ -62,7 +62,7 @@ char *alloca ();
 #define        major(dev)              (dev)
 #define        minor(dev)              (dev)
 typedef long off_t;
-#endif /* __MSDOS__ */
+#endif /* __MSDOS__ */
 
 #if defined(__STDC__) || defined(__TURBOC__)
 #define PTR void *
@@ -116,17 +116,17 @@ typedef long off_t;
 #if defined(STDC_HEADERS)
 #include <stdlib.h>
 #else
-char *malloc(), *realloc();
-char *getenv();
+char *malloc (), *realloc ();
+char *getenv ();
 #endif
 
 #ifndef _POSIX_VERSION
 #ifdef __MSDOS__
 #include <io.h>
-#else                          /* !__MSDOS__ */
-off_t lseek();
-#endif                         /* !__MSDOS__ */
-char *getcwd();
+#else /* !__MSDOS__ */
+off_t lseek ();
+#endif /* !__MSDOS__ */
+char *getcwd ();
 #endif /* !_POSIX_VERSION */
 
 #ifndef NULL
@@ -175,14 +175,14 @@ char *getcwd();
 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
 #define        S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
 #endif
-#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
+#if !defined(S_ISMPB) && defined(S_IFMPB)      /* V7 */
 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
 #endif
-#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
+#if !defined(S_ISNWK) && defined(S_IFNWK)      /* HP/UX */
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
-#if !defined(S_ISCTG) && defined(S_IFCTG) /* contiguous file */
+#if !defined(S_ISCTG) && defined(S_IFCTG)      /* contiguous file */
 #define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG)
 #endif
 #if !defined(S_ISVTX)
This page took 0.023743 seconds and 4 git commands to generate.