X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs.c;h=87106bb0c6c7d0cb5dbaa6cecf7d9541f9f3dcdb;hb=408cd870b8612dba174aab849239016f66c2d2cd;hp=290360e97a9bf88ad6ee6665cb918ade078d64d3;hpb=bf769f960dc086ca35e60a1ecf88ebc385e1c222;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 290360e..87106bb 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -2771,7 +2771,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 +2798,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); } @@ -3976,9 +3976,9 @@ static int nfs_chmod_continue_internal(struct nfs_context *nfs, fattr3 *attr _U_ } -int nfs_chmod_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data) +int nfs_chmod_async_internal(struct nfs_context *nfs, const char *path, int no_follow, int mode, nfs_cb cb, void *private_data) { - if (nfs_lookuppath_async(nfs, path, 0, cb, private_data, nfs_chmod_continue_internal, NULL, NULL, mode) != 0) { + if (nfs_lookuppath_async(nfs, path, no_follow, cb, private_data, nfs_chmod_continue_internal, NULL, NULL, mode) != 0) { rpc_set_error(nfs->rpc, "Out of memory: failed to start parsing the path components"); return -1; } @@ -3986,6 +3986,16 @@ int nfs_chmod_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb return 0; } +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); +} + +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); +} + /* * Async fchmod() */ @@ -4228,8 +4238,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 +4252,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 +4260,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() */