]> err.no Git - varnish/commitdiff
Correct the lock.l_type logic for platforms where O_RDONLY is 0.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 20 Aug 2007 15:18:49 +0000 (15:18 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 20 Aug 2007 15:18:49 +0000 (15:18 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1896 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvarnish/flopen.c

index f324c7afe6e9b2873e3393bbb10aaccefd731c7a..4d2c52404964e78dbac5598eea37cbe3acb85f03 100644 (file)
@@ -60,7 +60,7 @@ flopen(const char *path, int flags, ...)
                va_end(ap);
        }
 
-       lock.l_type = (flags & O_RDONLY) ? F_RDLCK : F_WRLCK;
+       lock.l_type = ((flags & O_ACCMODE) == O_RDONLY) ? F_RDLCK : F_WRLCK;
        lock.l_start = 0;
        lock.l_whence = SEEK_SET;
        lock.l_len = 0;