From: des Date: Mon, 20 Aug 2007 15:18:49 +0000 (+0000) Subject: Correct the lock.l_type logic for platforms where O_RDONLY is 0. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24fa8739e6426c8446b8b7ccbc7bc19fb6f11390;p=varnish Correct the lock.l_type logic for platforms where O_RDONLY is 0. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1896 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/lib/libvarnish/flopen.c b/varnish-cache/lib/libvarnish/flopen.c index f324c7af..4d2c5240 100644 --- a/varnish-cache/lib/libvarnish/flopen.c +++ b/varnish-cache/lib/libvarnish/flopen.c @@ -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;