diff options
author | Pixel <pixel@nobis-crew.org> | 2009-02-02 06:54:46 +0100 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-02-02 06:54:46 +0100 |
commit | 2a6b51c13e06dd3ded2b419339a6c4f72d8a365c (patch) | |
tree | 53c02c9e5a2448444b4b2a707c2bef9a1cde773a /lib | |
parent | 6b289035db4f728a1987c42a56cc1cd484c8e97a (diff) | |
parent | a6d6e86e81f6556696cba4e1971c684feb2608cd (diff) |
Merge branch 'master' of ssh+git://pixel@git.grumpycoder.net/pub/repo.git/Baltisot
Diffstat (limited to 'lib')
-rw-r--r-- | lib/String.cc | 2 | ||||
-rw-r--r-- | lib/TaskMan.cc | 18 | ||||
-rw-r--r-- | lib/generic.cc | 2 |
3 files changed, 17 insertions, 5 deletions
diff --git a/lib/String.cc b/lib/String.cc index 08818eb..0b7b3e6 100644 --- a/lib/String.cc +++ b/lib/String.cc @@ -575,7 +575,7 @@ String String::trim() const { String & String::iconv(const String & from, const String & _to) { iconv_t cd; String to = _to + "//TRANSLIT"; -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) char * inbuf; #else const char * inbuf; diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index e3ebd9a..83fe5aa 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -326,7 +326,12 @@ void TaskMan::Init() throw (GeneralException) { signal(SIGPIPE, taskman_sigpipe); signal(SIGHUP, taskman_sighup); signal(SIGUSR1, taskman_sigusr1); - + +#ifdef __APPLE__ + sigemptyset(&sigchildset); + sigaddset(&sigchildset, SIGCHLD); + sigprocmask(SIG_BLOCK, &sigchildset, 0); +#else sigset_t sigtempset; sigemptyset(&sigchildset); @@ -335,7 +340,8 @@ void TaskMan::Init() throw (GeneralException) { sigprocmask(SIG_SETMASK, 0, &sigtempset); sigaddset(&sigtempset, SIGCHLD); sigprocmask(SIG_SETMASK, &sigtempset, 0); -#endif +#endif +#endif inited = true; number = 0; @@ -683,8 +689,14 @@ void TaskMan::MainLoop() throw (GeneralException) { bool timeout_condition = no_burst && !Zombies.size() && !got_sigchild && !got_yield; -#ifdef _WIN32 +#if defined(_WIN32) || defined(__APPLE__) +#ifdef __APPLE__ + sigprocmask(SIG_UNBLOCK, &sigchildset, 0); +#endif r = poll(ufsd, nfds, timeout_condition ? timeout : 0); +#ifdef __APPLE__ + sigprocmask(SIG_BLOCK, &sigchildset, 0); +#endif #else struct timespec ttimeout = { 0, 0 }; if ((timeout != -1) && timeout_condition) { diff --git a/lib/generic.cc b/lib/generic.cc index 24a7456..689a83c 100644 --- a/lib/generic.cc +++ b/lib/generic.cc @@ -89,7 +89,7 @@ static bool wrapper_printer(printer_t * prt, int level, const char * msg, ...) { bool r; va_list ap; - va_start(ap, prt); + va_start(ap, msg); r = prt->printm(level, msg, ap); va_end(ap); |