]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Revert "libuuid: do not check for EAGAIN after flock()"
authorKarel Zak <kzak@redhat.com>
Fri, 18 Feb 2011 09:52:22 +0000 (10:52 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 18 Feb 2011 09:52:22 +0000 (10:52 +0100)
 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.

shlibs/uuid/src/gen_uuid.c

index b47c13f6c18631cb464aa717087e942992c2a084..f4c89973fd83cfd8fe01da381d12e8ccdaa2a1e1 100644 (file)
@@ -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);