From 4b6849c9a7a16451da5a3666f558036570f7a9bd 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 Signed-off-by: LaMont Jones --- mount/mount.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mount/mount.c b/mount/mount.c index 6a154ae1..63df235d 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -1196,8 +1196,14 @@ 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) - && (fd = open(spec, O_RDONLY | O_NONBLOCK)) >= 0) { + 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 (ioctl(fd, BLKGETSIZE, &size) == 0) { if (size == 0 && !loop) { warned++; -- 2.39.5