nilfs2-utils: change the error message of nilfs-tune properly
PATCH 1/1 nilfs2-utils: change the error message of nilfs-tune properly
hi,
This patch modifies the error message of nilfs-tune when user doesn't have a permission to access the device to show the cause of error clearly.
Signed-off-by Jiro SEKIBA <[email protected]>
--- sbin/nilfs-tune/nilfs-tune.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
sbin/nilfs-tune/nilfs-tune.c +3 -1
@@ -394,10 +394,12 @@ int modify_nilfs(char *device, struct nilfs_tune_options *opts)struct nilfs_super_block *sbp;__u64 features; + errno =0 ; devfd =open (device, opts->flags);if (devfd ==-1 ) { -fprintf (stderr,"%s: cannot open NILFS\n" , device); +fprintf (stderr,"%s: cannot open device %s\n" , +strerror (errno), device); ret =EXIT_FAILURE ; goto out; }
Signature · 6 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 15 lines · Jiro SEKIBA
hi,
This patch modifies the error message of nilfs-tune when user doesn't have a permission to access the device to show the cause of error clearly.
Signed-off-by Jiro SEKIBA <[email protected]>--- sbin/nilfs-tune/nilfs-tune.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)sbin/nilfs-tune/nilfs-tune.c +0
-0
sbin/nilfs-tune/nilfs-tune.c int modify_nilfs(char *device, struct nilfs_tune_options *opts) · line 402
Quoted 10 lines
sbin/nilfs-tune/nilfs-tune.c +3
-1@@ -394,10 +394,12 @@ int modify_nilfs(char *device, struct nilfs_tune_options *opts)struct nilfs_super_block *sbp;__u64 features; + errno =0 ; devfd =open (device, opts->flags);if (devfd ==-1 ) { -fprintf (stderr,"%s: cannot open NILFS\n" , device); +fprintf (stderr,"%s: cannot open device %s\n" , +strerror (errno), device);
How about putting the error string behind the primary message?
fprintf(stderr, "cannot open device %s: %s\n", device, strerror(errno));
Thanks,
Ryusuke Konishi
Quoted 6 lines
sbin/nilfs-tune/nilfs-tune.c +0
-0ret =EXIT_FAILURE ; goto out; }Signature · 1 line
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html