X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fmount%2Fnfs4mount.c;h=f98e275252534e95fc5e0432b93a116592ac2774;hb=c940b820c790d7c595f92e3c8eb59a1b4adf5f96;hp=4f6fc5f87b02fdecc7fc9b2c6fcfe04fee4bdce5;hpb=e9b0bed761bc77ba046f53be2ec324c4b61357ff;p=nfs-utils.git diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c index 4f6fc5f..f98e275 100644 --- a/utils/mount/nfs4mount.c +++ b/utils/mount/nfs4mount.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -41,8 +42,10 @@ #include "conn.h" #include "xcommon.h" +#include "mount_constants.h" #include "nfs4_mount.h" #include "nfs_mount.h" +#include "error.h" #if defined(VAR_LOCK_DIR) #define DEFAULT_DIR VAR_LOCK_DIR @@ -164,9 +167,8 @@ static int get_my_ipv4addr(char *ip_addr, int len) return 0; } -int nfs4mount(const char *spec, const char *node, int *flags, - char **extra_opts, char **mount_opts, - int running_bg) +int nfs4mount(const char *spec, const char *node, int flags, + char **extra_opts, int fake) { static struct nfs4_mount_data data; static char hostdir[1024]; @@ -440,8 +442,14 @@ int nfs4mount(const char *spec, const char *node, int *flags, continue; } - *mount_opts = (char *) &data; - /* clean up */ + if (!fake) { + if (mount(spec, node, "nfs4", + flags & ~(MS_USER|MS_USERS), &data)) { + mount_error(spec, node, errno); + goto fail; + } + } + return 0; fail: