summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-04-20 02:58:30 +0000
committermarcel <marcel@FreeBSD.org>2003-04-20 02:58:30 +0000
commit1c8591b44bd83cad0ddb1f2232d9bb6efe1365c9 (patch)
tree019312718cfe0b48b2ce28fe6393e469f9ee4e3d /lib/libthr
parent5e1c0b2c267a5ae98ea8efcf171f35291d51245e (diff)
downloadFreeBSD-src-1c8591b44bd83cad0ddb1f2232d9bb6efe1365c9.zip
FreeBSD-src-1c8591b44bd83cad0ddb1f2232d9bb6efe1365c9.tar.gz
Use STDERR_FILENO as the file descriptor passed to _thread_printf()
instead of 0 (ie stdin). Writing to stdin may not be possible.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_kern.c11
1 files changed, 7 insertions, 4 deletions
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 <pthread.h>
#include <signal.h>
#include <errno.h>
+#include <unistd.h>
#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
OpenPOWER on IntegriCloud