Skip to contentSkip to conversation

nilfs2-utils: change the error message of nilfs-tune properlyx

PATCH Applied Jiro SEKIBA 2 participants 2 messages Sep 15, 2010 1 message not in the archive NILFS2 filesystem

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 nilfs2-utils: change the error message of nilfs-tune properlyx

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.

---
 sbin/nilfs-tune/nilfs-tune.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
sbin/nilfs-tune/nilfs-tune.c +3 -1
index d99ce46..e80caa4 100644
@@ -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;
 	}
Signature · 6 lines
1.5.6.5

--
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

A message that is not in the archive (sent off-list or not yet received): 8739tbfq2b.wl%[email protected]

#2 lore raw
Quoted 9 lines · Jiro SEKIBA

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.

Applied.

Thanks,
Ryusuke Konishi

Quoted 24 lines
---
 sbin/nilfs-tune/nilfs-tune.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
sbin/nilfs-tune/nilfs-tune.c +3 -1
index d99ce46..e80caa4 100644
@@ -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;
 	}
Signature · 1 line
1.5.6.5

--
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