mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Print more details in search/import if a file disappears
This commit is contained in:
parent
a31624f95a
commit
41a3692430
2 changed files with 12 additions and 2 deletions
|
|
@ -174,7 +174,12 @@ int state_import_fetch(struct snapraid_state* state, int rehash, struct snapraid
|
|||
f = open(path, O_RDONLY | O_BINARY);
|
||||
if (f == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Error opening file '%s'. %s.\n", path, strerror(errno));
|
||||
if (errno == ENOENT) {
|
||||
log_fatal("DANGER! file '%s' disappeared.\n", path);
|
||||
log_fatal("If you moved it, please rerun the same command.\n");
|
||||
} else {
|
||||
log_fatal("Error opening file '%s'. %s.\n", path, strerror(errno));
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,12 @@ int search_file_compare(const void* void_arg, const void* void_data)
|
|||
f = open(path, O_RDONLY | O_BINARY);
|
||||
if (f == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Error opening file '%s'. %s.\n", path, strerror(errno));
|
||||
if (errno == ENOENT) {
|
||||
log_fatal("DANGER! file '%s' disappeared.\n", path);
|
||||
log_fatal("If you moved it, please rerun the same command.\n");
|
||||
} else {
|
||||
log_fatal("Error opening file '%s'. %s.\n", path, strerror(errno));
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue