mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-22 15:47:37 +00:00
Use STDERR_FILENO as the file descriptor passed to _thread_printf()
instead of 0 (ie stdin). Writing to stdin may not be possible.
This commit is contained in:
parent
23408b001b
commit
09dd61fd99
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113733
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user