From 0926fc974d30259ad2f4dd6f7a24766e86f2c220 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 18 Feb 2013 15:51:21 -0800 Subject: [PATCH] Some systems lack flock() --- src/curvecp/libcurvecp/open_lock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/curvecp/libcurvecp/open_lock.c b/src/curvecp/libcurvecp/open_lock.c index 898f3b60..b4d959c1 100644 --- a/src/curvecp/libcurvecp/open_lock.c +++ b/src/curvecp/libcurvecp/open_lock.c @@ -14,6 +14,8 @@ int open_lock(const char *fn) if (fd == -1) return -1; fcntl(fd,F_SETFD,1); #endif +#ifdef F_LOCK if (lockf(fd,F_LOCK,0) == -1) { close(fd); return -1; } +#endif return fd; }