From: Karel Zak Date: Fri, 18 Feb 2011 09:52:22 +0000 (+0100) Subject: Revert "libuuid: do not check for EAGAIN after flock()" X-Git-Tag: v2.20-rc1~545 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48399694a990759cb9e86e42d0582fb3da3a6a92;p=thirdparty%2Futil-linux.git Revert "libuuid: do not check for EAGAIN after flock()" Linux is not 100% POSIX compatible in this area... strace: "flock(3, LOCK_EX|LOCK_NB) = -1 EAGAIN (Resource temporarily unavailable)" This reverts commit d6c8d399b93f4646a90d0180fdcc1be35235a9c7. --- diff --git a/shlibs/uuid/src/gen_uuid.c b/shlibs/uuid/src/gen_uuid.c index b47c13f6c1..f4c89973fd 100644 --- a/shlibs/uuid/src/gen_uuid.c +++ b/shlibs/uuid/src/gen_uuid.c @@ -345,7 +345,7 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, if (state_fd >= 0) { rewind(state_f); while (flock(state_fd, LOCK_EX) < 0) { - if (errno == EINTR) + if ((errno == EAGAIN) || (errno == EINTR)) continue; fclose(state_f); close(state_fd);