*/
#define MODELEN 20
#define DATELEN 64
+#define DAYSPERNYEAR 365
+#define SECSPERDAY 86400
+#define VIS_CSTYLE 0
#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY)
#define CURFRMT "%b %e %H:%M"
#define OLDFRMT "%b %e %Y"
/*
* if printing to a tty, use vis(3) to print special characters.
*/
- if (isatty(fileno(fp))) {
+ if (0 && isatty(fileno(fp))) {
for (cp = str; *cp; cp++) {
(void)vis(visbuf, cp[0], VIS_CSTYLE, cp[1]);
(void)fputs(visbuf, fp);
static void printflg(unsigned int);
static int c_frmt(const void *, const void *);
static off_t str_offt(char *);
-static char *getline(FILE *fp);
+static char *bsd_getline(FILE *fp);
static void pax_options(int, char **);
static void pax_usage(void);
static void tar_options(int, char **);
paxwarn(1, "Unable to open file '%s' for read", file);
tar_usage();
}
- while ((str = getline(fp)) != NULL) {
+ while ((str = bsd_getline(fp)) != NULL) {
if (pat_add(str, dir) < 0)
tar_usage();
sawpat = 1;
paxwarn(1, "Unable to open file '%s' for read", file);
tar_usage();
}
- while ((str = getline(fp)) != NULL) {
+ while ((str = bsd_getline(fp)) != NULL) {
if (ftree_add(str, 0) < 0)
tar_usage();
}
paxwarn(1, "Unable to open file '%s' for read", optarg);
cpio_usage();
}
- while ((str = getline(fp)) != NULL) {
+ while ((str = bsd_getline(fp)) != NULL) {
pat_add(str, NULL);
}
fclose(fp);
* no read errors allowed on updates/append operation!
*/
maxflt = 0;
- while ((str = getline(stdin)) != NULL) {
+ while ((str = bsd_getline(stdin)) != NULL) {
ftree_add(str, 0);
}
if (getline_error) {
if ((num == LONG_MAX) || (num <= 0) || (expr == val))
# else
num = strtoq(val, &expr, 0);
- if ((num == QUAD_MAX) || (num <= 0) || (expr == val))
+ if ((num == LLONG_MAX) || (num <= 0) || (expr == val))
# endif
return(0);
}
char *
-getline(FILE *f)
+bsd_getline(FILE *f)
{
char *name, *temp;
size_t len;
char *ltmfrmt; /* -v locale time format (if any) */
char *argv0; /* root of argv[0] */
sigset_t s_mask; /* signal mask for cleanup critical sect */
-FILE *listf = stderr; /* file pointer to print file list to */
+FILE *listf; /* file pointer to print file list to */
char *tempfile; /* tempfile to use for mkstemp(3) */
char *tempbase; /* basename of tempfile to use for mkstemp(3) */
char *tmpdir;
size_t tdlen;
+ /*
+ * On some systems, stderr is not a constant, so we initialize listf
+ * immediately to emulate the behavior.
+ */
+ listf=stderr;
+
/*
* Keep a reference to cwd, so we can always come back home.
*/