From 351a93169ebb30295221c37a22726ff63137f2a5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 14 Dec 2007 15:09:22 +0100 Subject: [PATCH] mount: hint about helper program if device doesn't exist Addresses-Debian-Bug: #452330 Signed-off-by: Karel Zak --- mount/mount.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mount/mount.c b/mount/mount.c index 99ad9703..917f62ac 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -1227,7 +1227,13 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, " missing codepage or helper program, or other error"), spec); - if (stat(spec, &statbuf) == 0 && S_ISBLK(statbuf.st_mode) + if (stat(spec, &statbuf) < 0) { + if (errno == ENOENT) /* network FS? */ + error(_( + " (for several filesystems (e.g. nfs, cifs) you might\n" + " need a /sbin/mount. helper program)")); + + } else if (S_ISBLK(statbuf.st_mode) && (fd = open(spec, O_RDONLY | O_NONBLOCK)) >= 0) { if (blkdev_get_size(fd, &size) == 0) { -- 2.39.5