From 1fca493e08073b8060a00801c75d5be38ee06535 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Fri, 14 Feb 2003 07:42:53 +0000 Subject: [PATCH] mac compile fix svn path=/trunk/boinc/; revision=907 --- lib/util.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util.C b/lib/util.C index 0ea9a32697..40f6acc8e0 100755 --- a/lib/util.C +++ b/lib/util.C @@ -155,14 +155,14 @@ int lock_file(char* filename) { int retval; // some systems have both! +#ifdef HAVE_FLOCK + int lock = open(filename, O_WRONLY|O_CREAT, 0644); + retval = flock(lock, LOCK_EX|LOCK_NB); +#else #ifdef HAVE_LOCKF int lock = open(filename, O_WRONLY|O_CREAT, 0644); retval = lockf(lock, F_TLOCK, 1); // must leave fd open -#else -#ifdef HAVE_FLOCK - int lock = open(filename, O_WRONLY|O_CREAT, 0644); - retval = flock(lock, LOCK_EX|LOCK_NB); #endif #endif