1 --- dump/dump.h.orig Sun Dec 15 22:14:30 1996
2 +++ dump/dump.h Wed Dec 25 16:11:06 1996
4 * @(#)dump.h 8.2 (Berkeley) 4/28/95
7 +/* /etc/dumpdates will not be created, when not already here (Bug#3806).
10 #define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
11 #define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
14 int nddates; /* number of records (might be zero) */
15 int ddates_in; /* we have read the increment file */
16 struct dumpdates **ddatev; /* the arrayfied version */
17 -void initdumptimes __P((void));
18 -void getdumptime __P((void));
19 +void initdumptimes __P((int));
20 +void getdumptime __P((int));
21 void putdumptime __P((void));
22 #define ITITERATE(i, ddp) \
23 for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
24 --- dump/itime.c.orig Sun Dec 15 22:14:30 1996
25 +++ dump/itime.c Wed Dec 25 16:18:15 1996
27 * Remy Card <card@Linux.EU.Org>, 1994, 1995, 1996
30 +/* /etc/dumpdates will not be created, when not already here (Bug#3806).
34 * Copyright (c) 1980, 1993
36 static void readdumptimes __P((FILE *));
40 +initdumptimes(createdumpdates)
47 * Dumpdates does not exist, make an empty one.
49 - msg("WARNING: no file `%s', making an empty one\n", dumpdates);
50 - if ((df = fopen(dumpdates, "w")) == NULL) {
51 - quit("cannot create %s: %s\n", dumpdates,
54 + if (createdumpdates) {
55 + msg("WARNING: no file `%s', making an empty one\n", dumpdates);
56 + if ((df = fopen(dumpdates, "w")) == NULL) {
57 + quit("cannot create %s: %s\n", dumpdates,
62 + if ((df = fopen(dumpdates, "r")) == NULL) {
63 + quit("cannot read %s even after creating it: %s\n",
64 + dumpdates, strerror(errno));
70 + (void) flock(fileno(df), LOCK_SH);
73 - if ((df = fopen(dumpdates, "r")) == NULL) {
74 - quit("cannot read %s even after creating it: %s\n",
75 - dumpdates, strerror(errno));
79 - (void) flock(fileno(df), LOCK_SH);
90 +getdumptime(createdumpdates)
93 register struct dumpdates *ddp;
100 + initdumptimes(createdumpdates);
104 * Go find the entry with the same name for a lower increment
106 --- dump/main.c.orig Sun Dec 15 22:14:30 1996
107 +++ dump/main.c Wed Dec 25 16:09:26 1996
109 * Remy Card <card@Linux.EU.Org>, 1994, 1995, 1996
112 +/* /etc/dumpdates will not be created, when not already here (Bug#3806).
116 * Copyright (c) 1980, 1991, 1993, 1994
118 spcl.c_level = level - '0';
119 spcl.c_type = TS_TAPE;
121 - getdumptime(); /* /etc/dumpdates snarfed */
122 + getdumptime(uflag); /* /etc/dumpdates snarfed */
124 msg("Date of this level %c dump: %s", level,
126 --- dump/optr.c.orig Sun Dec 15 22:14:30 1996
127 +++ dump/optr.c Wed Dec 25 16:09:26 1996
129 * Remy Card <card@Linux.EU.Org>, 1994, 1995, 1996
132 +/* /etc/dumpdates will not be created, when not already here (Bug#3806).
136 * Copyright (c) 1980, 1988, 1993
137 @@ -534,22 +536,24 @@
140 register struct fstab *dt;
141 - register struct dumpdates *dtwalk;
142 + register struct dumpdates *dtwalk=NULL;
143 char *lastname, *date;
148 getfstab(); /* /etc/fstab input */
149 - initdumptimes(); /* /etc/dumpdates input */
150 - qsort((char *) ddatev, nddates, sizeof(struct dumpdates *), datesort);
153 - (void) printf("Dump these file systems:\n");
155 + initdumptimes(0); /* /etc/dumpdates input */
156 + if (*ddatev != NULL)
158 + qsort((char *) ddatev, nddates, sizeof(struct dumpdates *), datesort);
161 + (void) printf("Dump these file systems:\n");
163 (void) printf("Last dump(s) done (Dump '>' file systems):\n");
165 - ITITERATE(i, dtwalk) {
167 + ITITERATE(i, dtwalk) {
168 if (strncmp(lastname, dtwalk->dd_name,
169 sizeof(dtwalk->dd_name)) == 0)
172 dt ? dt->fs_file : "",