From 3289797248fee7367ebb990c95747b89e221dfc1 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 22 Nov 2016 09:40:35 +0800 Subject: [PATCH] flock fallback: remove noop path "fail to no locking" is not an ideal strategy. --- src/fallback.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/fallback.cpp b/src/fallback.cpp index aafa090fd..aac1cecac 100644 --- a/src/fallback.cpp +++ b/src/fallback.cpp @@ -498,14 +498,12 @@ static int mk_wcswidth(const wchar_t *pwcs, size_t n) { */ /* - * Emulate flock() with fcntl(), where available. - * Otherwise, don't do locking; just pretend success. + * Emulate flock() with fcntl(). */ int flock(int fd, int op) { int rc = 0; -#if defined(F_SETLK) && defined(F_SETLKW) struct flock fl = {0}; switch (op & (LOCK_EX|LOCK_SH|LOCK_UN)) { @@ -531,7 +529,6 @@ int flock(int fd, int op) { if (rc && (errno == EAGAIN)) errno = EWOULDBLOCK; -#endif return rc; }