From 1c8591b44bd83cad0ddb1f2232d9bb6efe1365c9 Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 20 Apr 2003 02:58:30 +0000 Subject: Use STDERR_FILENO as the file descriptor passed to _thread_printf() instead of 0 (ie stdin). Writing to stdin may not be possible. --- lib/libthr/thread/thr_kern.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/libthr/thread') diff --git a/lib/libthr/thread/thr_kern.c b/lib/libthr/thread/thr_kern.c index 2f9e086..2b1dcc3 100644 --- a/lib/libthr/thread/thr_kern.c +++ b/lib/libthr/thread/thr_kern.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "thr_private.h" @@ -69,14 +70,15 @@ GIANT_LOCK(pthread_t pthread) #if 0 error = __sys_sigprocmask(SIG_SETMASK, &set, &sav); if (error) { - _thread_printf(0, "GIANT_LOCK: sig err %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_LOCK: sig err %d\n", + errno); abort(); } #endif error = umtx_lock(&_giant_mutex, pthread->thr_id); if (error) { - _thread_printf(0, "GIANT_LOCK: %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_LOCK: %d\n", errno); abort(); } @@ -99,7 +101,7 @@ GIANT_UNLOCK(pthread_t pthread) error = umtx_unlock(&_giant_mutex, pthread->thr_id); if (error) { - _thread_printf(0, "GIANT_UNLOCK: %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_UNLOCK: %d\n", errno); abort(); } @@ -109,7 +111,8 @@ GIANT_UNLOCK(pthread_t pthread) */ error = __sys_sigprocmask(SIG_SETMASK, &set, NULL); if (error) { - _thread_printf(0, "GIANT_UNLOCK: sig err %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_UNLOCK: sig err %d\n", + errno); abort(); } #endif -- cgit v1.1