[PATCH] nilfs2-utils: change the error message of nilfs-tune properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jir@xxxxxxxxx>
---
 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 18513f2..f6cdd36 100644
--- a/sbin/nilfs-tune/nilfs-tune.c
+++ b/sbin/nilfs-tune/nilfs-tune.c
@@ -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;
 	}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux BTRFS]     [Linux CIFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux