+static int try_mount(char *spec, char *mount_point, int flags,
+ char *fs_type, char **extra_opts, char *mount_opts,
+ int fake, int bg)
+{
+ int ret;
+
+ if (string)
+ ret = nfsmount_string(spec, mount_point, fs_type, flags,
+ extra_opts, fake, bg);
+ else {
+ if (strcmp(fs_type, "nfs4") == 0)
+ ret = nfs4mount(spec, mount_point, flags,
+ extra_opts, fake, bg);
+ else
+ ret = nfsmount(spec, mount_point, flags,
+ extra_opts, fake, bg);
+ }
+
+ if (ret)
+ return ret;
+
+ if (!fake)
+ print_one(spec, mount_point, fs_type, mount_opts);
+
+ return add_mtab(spec, mount_point, fs_type, flags, *extra_opts);
+}
+