diff --git a/573file/ifs.c b/573file/ifs.c index 73a63b8..48ee047 100644 --- a/573file/ifs.c +++ b/573file/ifs.c @@ -95,8 +95,6 @@ int ifs_open(struct ifs **out, const char *path) { r = fs_open(&ifs->f, path, "rb"); if (r < 0) { - log_write("%s: Error opening file: %s (%i)", path, strerror(-r), r); - goto end; } diff --git a/ifsdump/main.c b/ifsdump/main.c index 5969038..d954846 100644 --- a/ifsdump/main.c +++ b/ifsdump/main.c @@ -168,8 +168,6 @@ static int ifs_dump_file(struct ifs *ifs, const struct ifs_iter *child, r = fs_open(&f, path, "wb"); if (r < 0) { - log_write("fopen %s: %s (%i)", path, strerror(-r), r); - goto end; } diff --git a/util/fs.c b/util/fs.c index 9d36b54..8a51496 100644 --- a/util/fs.c +++ b/util/fs.c @@ -12,6 +12,7 @@ int fs_open(FILE **out, const char *path, const char *mode) { FILE *f; + int r; assert(out != NULL); assert(path != NULL); @@ -21,7 +22,10 @@ int fs_open(FILE **out, const char *path, const char *mode) { f = fopen(path, mode); if (f == NULL) { - return -errno; + r = -errno; + log_write("Error opening \"%s\": %s (%i)", path, strerror(-r), r); + + return r; } *out = f;