summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-12-12 12:59:27 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-12-12 12:59:27 +0000
commit9122dcecbba9d5268d1087918ffe5a3b970625b8 (patch)
tree40d5bb8d6dac68d58962c78474a72ebf5e96f6c9 /src
parent6776a52bb380bb2567847c6e50e1d7880ad7847a (diff)
downloadguix-9122dcecbba9d5268d1087918ffe5a3b970625b8.tar.gz
* We can't use string objects in signal handlers because they might
  allocate memory, which is verboten in signal handlers.  This caused
  random failures in the test suite on Mac OS X (triggered by the spurious
  SIGPOLL signals on Mac OS X, which should also be fixed).

Diffstat (limited to 'src')
-rw-r--r--src/nix-worker/nix-worker.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc
index 2c3f44cc08..674aae0b10 100644
--- a/src/nix-worker/nix-worker.cc
+++ b/src/nix-worker/nix-worker.cc
@@ -112,12 +112,12 @@ static void sigPollHandler(int sigNo)
                 _isInterrupted = 1;
                 blockInt = 1;
                 canSendStderr = false;
-                string s = "SIGPOLL\n";
-                write(STDERR_FILENO, s.c_str(), s.size());
+                char * s = "SIGPOLL\n";
+                write(STDERR_FILENO, s, strlen(s));
             }
         } else {
-            string s = "spurious SIGPOLL\n";
-            write(STDERR_FILENO, s.c_str(), s.size());
+            char * s = "spurious SIGPOLL\n";
+            write(STDERR_FILENO, s, strlen(s));
         }
     }
     catch (Error & e) {