- /*
- * Dumpdates does not exist, make an empty one.
- */
- msg("WARNING: no file `%s', making an empty one\n", dumpdates);
- if ((df = fopen(dumpdates, "w")) == NULL) {
- quit("cannot create %s: %s\n", dumpdates,
- strerror(errno));
- /* NOTREACHED */
+ if (createdumpdates) {
+ /*
+ * Dumpdates does not exist, make an empty one.
+ */
+ msg("WARNING: no file `%s', making an empty one\n", dumpdates);
+ if ((df = fopen(dumpdates, "w")) == NULL) {
+ quit("cannot create %s: %s\n", dumpdates,
+ strerror(errno));
+ /* NOTREACHED */
+ }
+ (void) fclose(df);
+ if ((df = fopen(dumpdates, "r")) == NULL) {
+ quit("cannot read %s even after creating it: %s\n",
+ dumpdates, strerror(errno));
+ /* NOTREACHED */
+ }