From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiro SEKIBA Subject: [PATCHv2] nilfs2-utils: change the error message of nilfs-tune properlyx Date: Wed, 15 Sep 2010 16:01:32 +0900 Message-ID: <8739tbfq2b.wl%jir@sekiba.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Return-path: Sender: linux-nilfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Ryusuke Konishi , Ryusuke Konishi Hi, Change the error message of nilfs-tune when user doesn't have a permission to access the device to show the cause of error clearly. differences from v1 - moved the error string behind the primary message. Signed-off-by: Jiro SEKIBA --- sbin/nilfs-tune/nilfs-tune.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/sbin/nilfs-tune/nilfs-tune.c b/sbin/nilfs-tune/nilfs-tune.c index d99ce46..e80caa4 100644 --- a/sbin/nilfs-tune/nilfs-tune.c +++ b/sbin/nilfs-tune/nilfs-tune.c @@ -399,10 +399,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, "cannot open device %s: %s\n", + device, strerror(errno)); ret = EXIT_FAILURE; goto out; } -- 1.5.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html