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;}
#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
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.");
int device;
{
DIR *dirp;
- register struct direct *d;
+ register struct dirent *d;
char *new_buf;
char *namebuf;
int bufsiz;
/* 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);
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);
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;
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);
{
struct stat sbuf;
DIR *dirp;
- struct direct *dp;
+ struct dirent *dp;
char *path_buf;
/* int path_len; */
#include <alloca.h>
#else /* not HAVE_ALLOCA_H */
#ifdef _AIX
- #pragma alloca
+#pragma alloca
#else /* not _AIX */
char *alloca ();
#endif /* not _AIX */
#define major(dev) (dev)
#define minor(dev) (dev)
typedef long off_t;
-#endif /* __MSDOS__ */
+#endif /* __MSDOS__ */
#if defined(__STDC__) || defined(__TURBOC__)
#define PTR void *
#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
#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)