X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs-sync.c;h=39c68c6bf6fb12b0a345c839e79e2f09989ffe7f;hb=037a1061ddfa9ee5192daa4485794bee7657aa31;hp=6e329f96af76f37b761a5f6e0a9ce529feca7646;hpb=9e6ac3d4ee1b9d7c5bf1598b1b82a13183e013bd;p=deb_libnfs.git diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 6e329f9..39c68c6 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -29,6 +29,10 @@ #include "win32_compat.h" #endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + #ifdef HAVE_NET_IF_H #include #endif @@ -49,10 +53,6 @@ #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #ifdef HAVE_POLL_H #include #endif @@ -696,15 +696,15 @@ static void creat_cb(int status, struct nfs_context *nfs, void *data, void *priv *nfsfh = fh; } -int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh) +int nfs_create(struct nfs_context *nfs, const char *path, int flags, int mode, struct nfsfh **nfsfh) { struct sync_cb_data cb_data; cb_data.is_finished = 0; cb_data.return_data = nfsfh; - if (nfs_creat_async(nfs, path, mode, creat_cb, &cb_data) != 0) { - nfs_set_error(nfs, "nfs_creat_async failed"); + if (nfs_create_async(nfs, path, flags, mode, creat_cb, &cb_data) != 0) { + nfs_set_error(nfs, "nfs_create_async failed"); return -1; } @@ -713,6 +713,11 @@ int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh return cb_data.status; } +int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh) +{ + return nfs_create(nfs, path, 0, mode, nfsfh); +} + /* * mknod() */