From 57642a78929e35d58c25f416f523670effdc0f70 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 12 Sep 2001 03:53:07 +0000 Subject: Update. 2001-09-11 Ulrich Drepper * nscd/nscd_gethst_r.c: Don't expect IPv6 addresses for IPv4 lookup. Patch by Stephan Kulow. --- linuxthreads/manager.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'linuxthreads/manager.c') diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c index c7fd9653f2..41f53f38ef 100644 --- a/linuxthreads/manager.c +++ b/linuxthreads/manager.c @@ -130,7 +130,8 @@ __pthread_manager(void *arg) /* Raise our priority to match that of main thread */ __pthread_manager_adjust_prio(__pthread_main_thread->p_priority); /* Synchronize debugging of the thread manager */ - n = __libc_read(reqfd, (char *)&request, sizeof(request)); + n = TEMP_FAILURE_RETRY(__libc_read(reqfd, (char *)&request, + sizeof(request))); ASSERT(n == sizeof(request) && request.req_kind == REQ_DEBUG); ufd.fd = reqfd; ufd.events = POLLIN; @@ -150,8 +151,17 @@ __pthread_manager(void *arg) } /* Read and execute request */ if (n == 1 && (ufd.revents & POLLIN)) { - n = __libc_read(reqfd, (char *)&request, sizeof(request)); - ASSERT(n == sizeof(request)); + n = TEMP_FAILURE_RETRY(__libc_read(reqfd, (char *)&request, + sizeof(request))); +#ifdef DEBUG + if (n < 0) { + char d[64]; + write(STDERR_FILENO, d, snprintf(d, sizeof(d), "*** read err %m\n")); + } else if (n != sizeof(request)) { + write(STDERR_FILENO, "*** short read in manager\n", 26); + } +#endif + switch(request.req_kind) { case REQ_CREATE: request.req_thread->p_retcode = @@ -266,8 +276,8 @@ pthread_start_thread(void *arg) if (__pthread_threads_debug && __pthread_sig_debug > 0) { request.req_thread = self; request.req_kind = REQ_DEBUG; - __libc_write(__pthread_manager_request, - (char *) &request, sizeof(request)); + TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request, + (char *) &request, sizeof(request))); suspend(self); } /* Run the thread code */ @@ -921,7 +931,8 @@ void __pthread_manager_sighandler(int sig) struct pthread_request request; request.req_thread = 0; request.req_kind = REQ_KICK; - __libc_write(__pthread_manager_request, (char *) &request, sizeof(request)); + TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request, + (char *) &request, sizeof(request))); } } -- cgit v1.2.3