X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs-sync.c;h=2851a9109f4aeb625c6f171e8fd9a71afc446bc7;hb=10a1a78115069098419d32a042d99a56f62fb642;hp=8b57cb40b86eb29dd0958841eeca5e62c2ddd7d4;hpb=bf769f960dc086ca35e60a1ecf88ebc385e1c222;p=deb_libnfs.git diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 8b57cb4..2851a91 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -86,6 +86,10 @@ #include #endif +#ifdef HAVE_SYS_TIME_H +#include +#endif + #include "libnfs-zdr.h" #include "libnfs.h" #include "libnfs-raw.h" @@ -1015,6 +1019,22 @@ int nfs_chmod(struct nfs_context *nfs, const char *path, int mode) return cb_data.status; } +int nfs_lchmod(struct nfs_context *nfs, const char *path, int mode) +{ + struct sync_cb_data cb_data; + + cb_data.is_finished = 0; + + if (nfs_lchmod_async(nfs, path, mode, chmod_cb, &cb_data) != 0) { + nfs_set_error(nfs, "nfs_lchmod_async failed"); + return -1; + } + + wait_for_nfs_reply(nfs, &cb_data); + + return cb_data.status; +} + @@ -1170,6 +1190,22 @@ int nfs_utimes(struct nfs_context *nfs, const char *path, struct timeval *times) return cb_data.status; } +int nfs_lutimes(struct nfs_context *nfs, const char *path, struct timeval *times) +{ + struct sync_cb_data cb_data; + + cb_data.is_finished = 0; + + if (nfs_lutimes_async(nfs, path, times, utimes_cb, &cb_data) != 0) { + nfs_set_error(nfs, "nfs_lutimes_async failed"); + return -1; + } + + wait_for_nfs_reply(nfs, &cb_data); + + return cb_data.status; +} + /*