From 9122dcecbba9d5268d1087918ffe5a3b970625b8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 12 Dec 2008 12:59:27 +0000 Subject: [PATCH] * 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). --- src/nix-worker/nix-worker.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc index 2c3f44cc0..674aae0b1 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) {