diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-02-03T21·38+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-02-03T21·38+0000 |
commit | 4e17be7981026f0317fb12f166282be2d972889e (patch) | |
tree | eb24809ed97bee6275aaa16a1b65764d411071cf /src/libstore/pathlocks.cc | |
parent | f859a8d3c33cc275f41d983bfeff2a21a9f88f1b (diff) |
* Revert r19797, and use a simpler solution: just don't monitor build
hooks for silence. It's unnecessary because the remote nix-store command is already monitoring the real build.
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r-- | src/libstore/pathlocks.cc | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index fe872ceede87..d8290815c44c 100644 --- a/src/libstore/pathlocks.cc +++ b/src/libstore/pathlocks.cc @@ -37,8 +37,7 @@ void deleteLockFile(const Path & path, int fd) } -bool lockFile(int fd, LockType lockType, bool wait, - unsigned int progressInterval) +bool lockFile(int fd, LockType lockType, bool wait) { struct flock lock; if (lockType == ltRead) lock.l_type = F_RDLCK; @@ -50,20 +49,11 @@ bool lockFile(int fd, LockType lockType, bool wait, lock.l_len = 0; /* entire file */ if (wait) { - /* Wait until we acquire the lock. If `progressInterval' is - non-zero, when print a message every `progressInterval' - seconds. This is mostly to make sure that remote builders - aren't killed due to the `max-silent-time' inactivity - monitor while waiting for the garbage collector lock. */ - while (1) { - if (progressInterval) alarm(progressInterval); - if (fcntl(fd, F_SETLKW, &lock) == 0) break; + while (fcntl(fd, F_SETLKW, &lock) != 0) { checkInterrupt(); if (errno != EINTR) throw SysError(format("acquiring/releasing lock")); - if (progressInterval) printMsg(lvlError, "still waiting for lock..."); } - alarm(0); } else { while (fcntl(fd, F_SETLK, &lock) != 0) { checkInterrupt(); |