about summary refs log tree commit diff
path: root/linuxthreads/manager.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-09-12 03:53:07 +0000
committerUlrich Drepper <drepper@redhat.com>2001-09-12 03:53:07 +0000
commit57642a78929e35d58c25f416f523670effdc0f70 (patch)
treeaf543e6c01f354fe5894b66dbf382962a9d1e791 /linuxthreads/manager.c
parent455e8060b03bc12a2b3a25c9be92b5e420d806fd (diff)
downloadglibc-57642a78929e35d58c25f416f523670effdc0f70.tar.gz
glibc-57642a78929e35d58c25f416f523670effdc0f70.tar.xz
glibc-57642a78929e35d58c25f416f523670effdc0f70.zip
Update.
2001-09-11  Ulrich Drepper  <drepper@redhat.com>

	* nscd/nscd_gethst_r.c: Don't expect IPv6 addresses for IPv4 lookup.
	Patch by Stephan Kulow.
Diffstat (limited to 'linuxthreads/manager.c')
-rw-r--r--linuxthreads/manager.c23
1 files changed, 17 insertions, 6 deletions
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)));
   }
 }