X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmount%2Fstropts.c;h=e314b82f6034d2d1762e89847963761855cedfa6;hb=409487978593de13ae36be0ee56d8111ad6b3319;hp=29b1aaac39cff797e607c0350786687bb303bcb4;hpb=1f237ac72e6f563908b350e11fd2bb866c003028;p=nfs-utils.git diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 29b1aaa..e314b82 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -568,16 +568,18 @@ static int nfs_sys_mount(struct nfsmount_info *mi, struct mount_options *opts) char *options = NULL; int result; + if (mi->fake) + return 1; + if (po_join(opts, &options) == PO_FAILED) { errno = EIO; return 0; } - if (mi->fake) - return 1; - result = mount(mi->spec, mi->node, mi->type, mi->flags & ~(MS_USER|MS_USERS), options); + free(options); + if (verbose && result) { int save = errno; nfs_error(_("%s: mount(2): %s"), progname, strerror(save)); @@ -648,7 +650,7 @@ out_fail: static int nfs_try_mount_v3v2(struct nfsmount_info *mi) { struct addrinfo *ai; - int ret; + int ret = 0; for (ai = mi->address; ai != NULL; ai = ai->ai_next) { ret = nfs_do_mount_v3v2(mi, ai->ai_addr, ai->ai_addrlen); @@ -735,7 +737,7 @@ out_fail: static int nfs_try_mount_v4(struct nfsmount_info *mi) { struct addrinfo *ai; - int ret; + int ret = 0; for (ai = mi->address; ai != NULL; ai = ai->ai_next) { ret = nfs_do_mount_v4(mi, ai->ai_addr, ai->ai_addrlen);