if (unlink(dbfilename) == -1) {
retval = errno;
com_err(argv[0], retval, "deleting database file '%s'",dbfilename);
- goto aborted;
+ if (retval == ENOENT)
+ fprintf(stderr,
+ "Database appears to not exist--inspect files manually!\n");
+ else
+ fprintf(stderr,
+ "Database may be partially deleted--inspect files manually!\n");
+
+ exit(1);
}
(void) strcpy(dbfilename, dbname);
(void) strcat(dbfilename, ".pag");
retval = errno;
com_err(argv[0], retval, "deleting database file '%s'",dbfilename);
fprintf(stderr,
- "Database partially deleted--inspect files manually!\n");
+ "Database may be partially deleted--inspect files manually!\n");
exit(1);
}
(void) strcpy(dbfilename, dbname);
printf("** Database '%s' destroyed.\n", dbname);
exit(0);
}
- aborted:
- printf("** Destruction aborted--database left intact.\n");
exit(1);
}