]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nfs/xio.c
1/ be less trusting of information in /var/lib/nfs/xtab. Add things to
[nfs-utils.git] / support / nfs / xio.c
index 49ee6bc2eac3da43fc0d0dccd4330f7ccf38edaf..0a250fc4e05d7005cfe7f20adfde9a072b793f7f 100644 (file)
@@ -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;
        }