X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fnfs%2Fxio.c;h=0a250fc4e05d7005cfe7f20adfde9a072b793f7f;hb=5591654c71e7e2e5959c8718a7e880516b9081e8;hp=49ee6bc2eac3da43fc0d0dccd4330f7ccf38edaf;hpb=b4080e866ea058fb93e76f845689dae4f17ad559;p=nfs-utils.git diff --git a/support/nfs/xio.c b/support/nfs/xio.c index 49ee6bc..0a250fc 100644 --- a/support/nfs/xio.c +++ b/support/nfs/xio.c @@ -55,7 +55,7 @@ xflock(char *fname, char *type) struct flock fl = { readonly? F_RDLCK : F_WRLCK, SEEK_SET, 0, 0, 0 }; int fd; - if ((fd = open(fname, readonly? O_RDONLY : O_RDWR)) < 0) { + if ((fd = open(fname, readonly? O_RDONLY : (O_RDWR|O_CREAT))) < 0) { xlog(L_WARNING, "could not open %s for locking", fname); return -1; }