Merge pull request #96 from rosslagerwall/enotempty
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 11 Aug 2014 13:14:16 +0000 (06:14 -0700)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 11 Aug 2014 13:14:16 +0000 (06:14 -0700)
Map NFS3ERR_NOTEMPTY to ENOTEMPTY

lib/libnfs-sync.c
lib/libnfs-zdr.c
lib/libnfs.c
lib/socket.c

index 0fc10944f86e6572d13998958887721283b18dad..2851a9109f4aeb625c6f171e8fd9a71afc446bc7 100644 (file)
 #include <sys/sockio.h>
 #endif
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 #include "libnfs-zdr.h"
 #include "libnfs.h"
 #include "libnfs-raw.h"
index c32f661fc86cc8170940673e4b10c3d4deebce2d..90abe26d0f26e8184b452cb29703b67acd8799f0 100644 (file)
  * i.e. zdrmem_create() buffers.
  * It aims to be compatible with normal rpcgen generated functions.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #ifdef WIN32
 #include "win32_compat.h"
 #endif
 #include "aros_compat.h"
 #endif
 
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include <unistd.h>
 #include "libnfs-zdr.h"
+#include "libnfs.h"
+#include "libnfs-raw.h"
+#include "libnfs-private.h"
 
 struct opaque_auth _null_auth;
 
index 5692dc3dac174cc3ea5c84e2f42f8b268a6723c4..222721c39240f276e4d4b584f2dd80e6d5f9fe1a 100644 (file)
@@ -73,6 +73,7 @@
 #include <string.h>
 #include <assert.h>
 #include <errno.h>
+#include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -2771,7 +2772,7 @@ static void nfs_create_trunc_cb(struct rpc_context *rpc, int status, void *comma
 {
        struct nfs_cb_data *data = private_data;
        struct nfs_context *nfs = data->nfs;
-       struct nfsfh *nfsfh;
+       struct nfsfh *nfsfh = data->nfsfh;
        SETATTR3res *res;
 
        assert(rpc->magic == RPC_CONTEXT_MAGIC);
@@ -2798,7 +2799,7 @@ static void nfs_create_trunc_cb(struct rpc_context *rpc, int status, void *comma
                return;
        }
 
-       data->cb(0, nfs, data->nfsfh, data->private_data);
+       data->cb(0, nfs, nfsfh, data->private_data);
        free_nfs_cb_data(data);
 }
 
@@ -3988,12 +3989,12 @@ int nfs_chmod_async_internal(struct nfs_context *nfs, const char *path, int no_f
 
 int nfs_chmod_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data)
 {
-       return nfs_chown_async_internal(nfs, path, 0, mode, cb, private_data);
+       return nfs_chmod_async_internal(nfs, path, 0, mode, cb, private_data);
 }
 
 int nfs_lchmod_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data)
 {
-       return nfs_chown_async_internal(nfs, path, 1, mode, cb, private_data);
+       return nfs_chmod_async_internal(nfs, path, 1, mode, cb, private_data);
 }
 
 /*
index 3f7f89f90c9a368dc5ff6c48c0ab87f790d4e096..f8db957e0bb600510fcba27afc06dd04b2145c1b 100644 (file)
@@ -68,6 +68,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
+#include <time.h>
 #include <sys/types.h>
 #include "libnfs-zdr.h"
 #include "libnfs.h"