From 24fa8739e6426c8446b8b7ccbc7bc19fb6f11390 Mon Sep 17 00:00:00 2001 From: des Date: Mon, 20 Aug 2007 15:18:49 +0000 Subject: [PATCH] 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 --- varnish-cache/lib/libvarnish/flopen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5