libnfs: Add lutimes
[deb_libnfs.git] / lib / libnfs.c
index 290360e97a9bf88ad6ee6665cb918ade078d64d3..72d4df496262e8945dbb3c8a7800656207187e9f 100644 (file)
@@ -4228,8 +4228,7 @@ static int nfs_utimes_continue_internal(struct nfs_context *nfs, fattr3 *attr _U
        return 0;
 }
 
-
-int nfs_utimes_async(struct nfs_context *nfs, const char *path, struct timeval *times, nfs_cb cb, void *private_data)
+int nfs_utimes_async_internal(struct nfs_context *nfs, const char *path, int no_follow, struct timeval *times, nfs_cb cb, void *private_data)
 {
        struct timeval *new_times = NULL;
 
@@ -4243,7 +4242,7 @@ int nfs_utimes_async(struct nfs_context *nfs, const char *path, struct timeval *
                memcpy(new_times, times, sizeof(struct timeval)*2);
        }
 
-       if (nfs_lookuppath_async(nfs, path, 0, cb, private_data, nfs_utimes_continue_internal, new_times, free, 0) != 0) {
+       if (nfs_lookuppath_async(nfs, path, no_follow, cb, private_data, nfs_utimes_continue_internal, new_times, free, 0) != 0) {
                rpc_set_error(nfs->rpc, "Out of memory: failed to start parsing the path components");
                return -1;
        }
@@ -4251,6 +4250,16 @@ int nfs_utimes_async(struct nfs_context *nfs, const char *path, struct timeval *
        return 0;
 }
 
+int nfs_utimes_async(struct nfs_context *nfs, const char *path, struct timeval *times, nfs_cb cb, void *private_data)
+{
+       return nfs_utimes_async_internal(nfs, path, 0, times, cb, private_data);
+}
+
+int nfs_lutimes_async(struct nfs_context *nfs, const char *path, struct timeval *times, nfs_cb cb, void *private_data)
+{
+       return nfs_utimes_async_internal(nfs, path, 1, times, cb, private_data);
+}
+
 /*
  * Async utime()
  */