From 6519357e2ff7ad3f7dbc79dac5b41e5b1caac97b Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Tue, 23 Dec 2003 21:21:28 +0000 Subject: [PATCH] Fixes for NetBSD --- mbtask/mbtask.c | 5 +++-- mbtask/ping.c | 20 ++++++++++---------- mbtask/taskcomm.c | 5 +++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/mbtask/mbtask.c b/mbtask/mbtask.c index 21398fd2..a6bbabed 100644 --- a/mbtask/mbtask.c +++ b/mbtask/mbtask.c @@ -1031,9 +1031,10 @@ void *scheduler(void) static int call_entry = MAXTASKS; double loadavg[3]; pp_list *tpl; - sigset_t sigset, oldset; +// sigset_t sigset, oldset; Syslog('+', "Starting scheduler thread with pid %d", (int)getpid()); +/* rc = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); if (rc) Syslog('+', "pthread_setcancelstate(PTHREAD_CANCEL_DISABLE) rc=%d", rc); @@ -1044,7 +1045,7 @@ void *scheduler(void) rc = pthread_sigmask(SIG_SETMASK, &sigset, &oldset); if (rc) Syslog('+', "pthread_sigmask(SIG_SETMASK) rc=%d", rc); - +*/ sched_run = TRUE; pw = getpwuid(getuid()); diff --git a/mbtask/ping.c b/mbtask/ping.c index d370e081..90afe85b 100644 --- a/mbtask/ping.c +++ b/mbtask/ping.c @@ -338,19 +338,19 @@ void *ping_thread(void) static char pingaddress[41]; static time_t pingsend; time_t now; - sigset_t sigset, oldset; +// sigset_t sigset, oldset; Syslog('+', "Starting ping thread with pid %d", (int)getpid()); - rc = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - if (rc) - Syslog('+', "pthread_setcancelstate(PTHREAD_CANCEL_DISABLE) rc=%d", rc); +// rc = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); +// if (rc) +// Syslog('+', "pthread_setcancelstate(PTHREAD_CANCEL_DISABLE) rc=%d", rc); - rc = sigfillset(&sigset); - if (rc) - Syslog('+', "sigfillset() rc=%d", rc); - rc = pthread_sigmask(SIG_SETMASK, &sigset, &oldset); - if (rc) - Syslog('+', "pthread_sigmask(SIG_SETMASK) rc=%d", rc); +// rc = sigfillset(&sigset); +// if (rc) +// Syslog('+', "sigfillset() rc=%d", rc); +// rc = pthread_sigmask(SIG_SETMASK, &sigset, &oldset); +// if (rc) +// Syslog('+', "pthread_sigmask(SIG_SETMASK) rc=%d", rc); pingresult[1] = pingresult[2] = FALSE; pingnr = 2; diff --git a/mbtask/taskcomm.c b/mbtask/taskcomm.c index 16cb5099..8d4cbfc9 100644 --- a/mbtask/taskcomm.c +++ b/mbtask/taskcomm.c @@ -583,9 +583,10 @@ void *cmd_thread(void) int rlen, rc; struct pollfd pfd; static char buf[2048]; - sigset_t sigset, oldset; +// sigset_t sigset, oldset; Syslog('+', "Starting cmd thread with pid %d", (int)getpid()); +/* rc = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); if (rc) Syslog('+', "pthread_setcancelstate(PTHREAD_CANCEL_DISABLE) rc=%d", rc); @@ -596,7 +597,7 @@ void *cmd_thread(void) rc = pthread_sigmask(SIG_SETMASK, &sigset, &oldset); if (rc) Syslog('+', "pthread_sigmask(SIG_SETMASK) rc=%d", rc); - +*/ cmd_run = TRUE; while (! T_Shutdown) {