[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
83/376: Fix bogus pass by reference
From: |
Ludovic Courtès |
Subject: |
83/376: Fix bogus pass by reference |
Date: |
Wed, 28 Jan 2015 22:04:12 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit aa1560ca079148f5656cbec0d8057d551cb571ff
Author: Eelco Dolstra <address@hidden>
Date: Thu Jul 24 09:52:10 2014 +0200
Fix bogus pass by reference
http://hydra.nixos.org/build/12711659
---
src/libutil/monitor-fd.hh | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/src/libutil/monitor-fd.hh b/src/libutil/monitor-fd.hh
index 2cc495c..6f7f979 100644
--- a/src/libutil/monitor-fd.hh
+++ b/src/libutil/monitor-fd.hh
@@ -15,23 +15,19 @@ class MonitorFdHup
{
private:
std::thread thread;
- std::atomic_bool quit;
public:
MonitorFdHup(int fd)
{
- quit = false;
- thread = std::thread([&]() {
+ thread = std::thread([fd]() {
/* Wait indefinitely until a POLLHUP occurs. */
struct pollfd fds[1];
fds[0].fd = fd;
fds[0].events = 0;
if (poll(fds, 1, -1) == -1) {
if (errno != EINTR) abort(); // can't happen
- assert(quit);
return; // destructor is asking us to exit
}
- fprintf(stderr, "GOT: %d\n", fds[0].revents);
assert(fds[0].revents & POLLHUP);
/* We got POLLHUP, so send an INT signal to the main thread. */
kill(getpid(), SIGINT);
@@ -40,7 +36,6 @@ public:
~MonitorFdHup()
{
- quit = true;
pthread_kill(thread.native_handle(), SIGINT);
thread.join();
}
- 65/376: nix-daemon: Only print connection info if we have SO_PEERCRED, (continued)
- 65/376: nix-daemon: Only print connection info if we have SO_PEERCRED, Ludovic Courtès, 2015/01/28
- 69/376: Bump, Ludovic Courtès, 2015/01/28
- 62/376: Be more strict about file names in NARs, Ludovic Courtès, 2015/01/28
- 78/376: Pass -pthread only for programs that need it, Ludovic Courtès, 2015/01/28
- 80/376: Remove some dead code, Ludovic Courtès, 2015/01/28
- 72/376: Remove dead code, Ludovic Courtès, 2015/01/28
- 81/376: Add some assertions, Ludovic Courtès, 2015/01/28
- 82/376: More debugging, Ludovic Courtès, 2015/01/28
- 85/376: tests/remote-builds.nix: Don't try cache.nixos.org, Ludovic Courtès, 2015/01/28
- 79/376: Remove some obsolete files, Ludovic Courtès, 2015/01/28
- 83/376: Fix bogus pass by reference,
Ludovic Courtès <=
- 88/376: Refactor, Ludovic Courtès, 2015/01/28
- 87/376: tests/remote-builds.nix: Test failing build, Ludovic Courtès, 2015/01/28
- 89/376: build-remote.pl: Be less verbose on failing builds, Ludovic Courtès, 2015/01/28
- 86/376: nix-store --serve: Only monitor stdin during builds, Ludovic Courtès, 2015/01/28
- 77/376: nix-daemon: Less verbosity, Ludovic Courtès, 2015/01/28
- 74/376: nix-daemon: Use a thread instead of SIGPOLL to catch client disconnects, Ludovic Courtès, 2015/01/28
- 99/376: install-nix-from-closure.sh: Install cacert, Ludovic Courtès, 2015/01/28
- 93/376: nix-copy-closure: Implement --gzip via ssh's -C flag, Ludovic Courtès, 2015/01/28
- 91/376: Remove obsolete SSH master connection code, Ludovic Courtès, 2015/01/28
- 100/376: Rename nixPath to __nixPath, Ludovic Courtès, 2015/01/28