"mount" now reports errors from nfsmount() and assumes NFS mount
authorPavel Roskin <proski@gnu.org>
Tue, 6 Jun 2000 17:03:55 +0000 (17:03 -0000)
committerPavel Roskin <proski@gnu.org>
Tue, 6 Jun 2000 17:03:55 +0000 (17:03 -0000)
if ':' is present in the device name - Pavel Roskin

Changelog
mount.c
util-linux/mount.c

index 637f983e9a8d67b47e5d07ef2d201222f628bd12..7ac97dc71cbd1ef2dbb79f734b838ee0c892cf4c 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -57,6 +57,8 @@
        * Implemented "rm -- <foo>"
        * "which" rewritten to use stat(). Fixes to improve its compatability
            with traditional implementations -- Pavel Roskin.
+       * "mount" now reports errors from nfsmount() and assumes NFS mount
+           if ':' is present in the device name - Pavel Roskin
        * More doc updates
 
 
diff --git a/mount.c b/mount.c
index bde55d155f99ab6cecb68edee7679131e5bab197..ee6c9475ab3923091a614678a35e2939a09fc06e 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -483,11 +483,14 @@ extern int mount_main(int argc, char **argv)
        } else {
                if (device && directory) {
 #ifdef BB_NFSMOUNT
+                       if (strchr(device, ':') != NULL)
+                               filesystemType = "nfs";
                        if (strcmp(filesystemType, "nfs") == 0) {
-                               if (nfsmount
-                                       (device, directory, &flags, &extra_opts, &string_flags,
-                                        1) != 0)
-                                       exit(FALSE);
+                               int ret;
+                               ret = nfsmount (device, directory, &flags,
+                                               &extra_opts, &string_flags, 1);
+                               if (ret != 0)
+                                       fatalError("nfsmount failed: %s\n", strerror(errno));
                        }
 #endif
                        exit(mount_one(device, directory, filesystemType,
index bde55d155f99ab6cecb68edee7679131e5bab197..ee6c9475ab3923091a614678a35e2939a09fc06e 100644 (file)
@@ -483,11 +483,14 @@ extern int mount_main(int argc, char **argv)
        } else {
                if (device && directory) {
 #ifdef BB_NFSMOUNT
+                       if (strchr(device, ':') != NULL)
+                               filesystemType = "nfs";
                        if (strcmp(filesystemType, "nfs") == 0) {
-                               if (nfsmount
-                                       (device, directory, &flags, &extra_opts, &string_flags,
-                                        1) != 0)
-                                       exit(FALSE);
+                               int ret;
+                               ret = nfsmount (device, directory, &flags,
+                                               &extra_opts, &string_flags, 1);
+                               if (ret != 0)
+                                       fatalError("nfsmount failed: %s\n", strerror(errno));
                        }
 #endif
                        exit(mount_one(device, directory, filesystemType,