summaryrefslogtreecommitdiffstats
path: root/sbin/dump
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2004-12-02 13:56:53 +0000
committermaxim <maxim@FreeBSD.org>2004-12-02 13:56:53 +0000
commit8cd02762f1ffb0214c07ebb1e60b1251d4937039 (patch)
tree78ec36e533a8552b84a19c8c88432429be460c27 /sbin/dump
parent3e3573e4ca8ed69d0cbc87f05e2d8e06eedde33b (diff)
downloadFreeBSD-src-8cd02762f1ffb0214c07ebb1e60b1251d4937039.zip
FreeBSD-src-8cd02762f1ffb0214c07ebb1e60b1251d4937039.tar.gz
o Do not dump core in -W if dumpdates was not readable and ddatev == NULL.
PR: bin/69977 o Remove unused ddates_in. Obtained from: NetBSD MFC after: 3 weeks
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/dump.h4
-rw-r--r--sbin/dump/itime.c3
2 files changed, 2 insertions, 5 deletions
diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h
index 75b33d5..2224782 100644
--- a/sbin/dump/dump.h
+++ b/sbin/dump/dump.h
@@ -164,13 +164,13 @@ struct dumpdates {
time_t dd_ddate;
};
int nddates; /* number of records (might be zero) */
-int ddates_in; /* we have read the increment file */
struct dumpdates **ddatev; /* the arrayfied version */
void initdumptimes(void);
void getdumptime(void);
void putdumptime(void);
#define ITITERATE(i, ddp) \
- for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
+ if (ddatev != NULL) \
+ for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
void sig(int signo);
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c
index 99d43ad..de880bb 100644
--- a/sbin/dump/itime.c
+++ b/sbin/dump/itime.c
@@ -60,7 +60,6 @@ struct dumptime {
SLIST_HEAD(dthead, dumptime) dthead = SLIST_HEAD_INITIALIZER(dthead);
struct dumpdates **ddatev = 0;
int nddates = 0;
-int ddates_in = 0;
static void dumprecout(FILE *, const struct dumpdates *);
static int getrecord(FILE *, struct dumpdates *);
@@ -113,7 +112,6 @@ readdumptimes(FILE *df)
SLIST_INSERT_HEAD(&dthead, dtwalk, dt_list);
}
- ddates_in = 1;
/*
* arrayify the list, leaving enough room for the additional
* record that we may have to add to the ddate structure
@@ -177,7 +175,6 @@ putdumptime(void)
free((char *)ddatev);
ddatev = 0;
nddates = 0;
- ddates_in = 0;
readdumptimes(df);
if (fseek(df, 0L, 0) < 0)
quit("fseek: %s\n", strerror(errno));
OpenPOWER on IntegriCloud