Skip to contentSkip to conversation

e2fsck: Improve error message when device name misspelled

PATCH Applied Jan Kara 2 participants 2 messages Sep 8, 2010 – Sep 20, 2010

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 e2fsck: Improve error message when device name misspelled

When a device name is misspelled, we output the full text about specifying alternate superblock. This is slightly misleading because when the device cannot be open because of ENOENT, this certainly won't help. So just print that device does not exist and exit.

---
 e2fsck/unix.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Ted, would you please include this minor improvement? One of our users
complained about it. Thanks.

e2fsck/unix.c +2 -0
index 6cb2214..7eb269c 100644
@@ -1109,6 +1109,8 @@ failure:
 		else if (retval == EBUSY)
 			printf(_("Filesystem mounted or opened exclusively "
 				 "by another program?\n"));
+		else if (retval == ENOENT)
+			printf(_("Possibly non-existent device?\n"));
 #ifdef EROFS
 		else if (retval == EROFS)
 			printf(_("Disk write-protected; use the -n option "
Signature · 1 line
1.6.4.2
Applied
#1 lore raw
Quoted 6 lines · Jan Kara

When a device name is misspelled, we output the full text about specifying alternate superblock. This is slightly misleading because when the device cannot be open because of ENOENT, this certainly won't help. So just print that device does not exist and exit.

Applied, thanks for the patch!

- Ted