reiserfsprogs: use com_err in reiserfs_open
We dump failure messages to the terminal regardless of whether the caller wants them or not. This can be annoying when used as part of a general tool that tests to see which file system is on a device by calling its open routine. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
1 parent
59dc067e79
commit
3c0f2812b0
12 files changed
+100
-52
No files matched your search
+4
-2
@@ -398,6 +398,7 @@ int main(int argc, char **argv)
|
||||
struct reiserfs_journal_header *j_head;
|
||||
reiserfs_trans_t old, new;
|
||||
int Is_journal_or_maxtrans_size_specified = 0;
|
||||
long error;
|
||||
|
||||
program_name = strrchr(argv[0], '/');
|
||||
|
||||
@@ -560,9 +561,10 @@ int main(int argc, char **argv)
|
||||
/* device to be formatted */
|
||||
device_name = argv[optind];
|
||||
|
||||
fs = reiserfs_open(device_name, O_RDONLY, NULL, NULL, 1);
|
||||
fs = reiserfs_open(device_name, O_RDONLY, &error, NULL, 1);
|
||||
if (no_reiserfs_found(fs)) {
|
||||
message("Cannot open reiserfs on %s", device_name);
|
||||
message("Cannot open reiserfs on %s: %s", device_name,
|
||||
error_message(error));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user