]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 12 Sep 2001 03:53:07 +0000 (03:53 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 12 Sep 2001 03:53:07 +0000 (03:53 +0000)
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.

ChangeLog
linuxthreads/ChangeLog
linuxthreads/join.c
linuxthreads/manager.c
linuxthreads/pthread.c
linuxthreads/semaphore.c
nscd/nscd_gethst_r.c

index 52bdb75712423049ce8e9e166e83cd3332203e18..d7e60631bb7e649b7d02f71564745266d4ce6021 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
 2001-09-08  Ben Collins  <bcollins@debian.org>
 
        * sysdeps/arm/dl-machine.h (elf_machine_rel): Fix thinko in
index b85f8c94dff0c4e0ee7f5115445812498f1bfe50..b4c474a2a6e88b589d4635111b7f79c66bcfa0e3 100644 (file)
@@ -1,3 +1,12 @@
+2001-09-11  Ulrich Drepper  <drepper@redhat.com>
+            Wolfram Gloger <wg@malloc.de>
+
+       * join.c: Protect all communications from and to manager with
+       TEMP_FAILURE_RETRY.
+       * manager.c: Likewise.
+       * pthread.c: Likewise.
+       * smeaphore.c: Likewise.
+
 2001-08-29  Ulrich Drepper  <drepper@redhat.com>
 
        * spinlock.c (__pthread_lock): Top max_count value with
index a0cdb41cd3c7f7b20b54d6d2caf3adc563e2588e..a6ed08c97a1680a6be019ccd25833cd21778e3a2 100644 (file)
@@ -77,7 +77,8 @@ void __pthread_do_exit(void *retval, char *currentframe)
   if (self == __pthread_main_thread && __pthread_manager_request >= 0) {
     request.req_thread = self;
     request.req_kind = REQ_MAIN_THREAD_EXIT;
-    __libc_write(__pthread_manager_request, (char *)&request, sizeof(request));
+    TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+                                   (char *)&request, sizeof(request)));
     suspend(self);
     /* Main thread flushes stdio streams and runs atexit functions.
        It also calls a handler within LinuxThreads which sends a process exit
@@ -172,8 +173,8 @@ int pthread_join(pthread_t thread_id, void ** thread_return)
     request.req_thread = self;
     request.req_kind = REQ_FREE;
     request.req_args.free.thread_id = thread_id;
-    __libc_write(__pthread_manager_request,
-                (char *) &request, sizeof(request));
+    TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+                                   (char *) &request, sizeof(request)));
   }
   return 0;
 }
@@ -210,8 +211,8 @@ int pthread_detach(pthread_t thread_id)
     request.req_thread = thread_self();
     request.req_kind = REQ_FREE;
     request.req_args.free.thread_id = thread_id;
-    __libc_write(__pthread_manager_request,
-                (char *) &request, sizeof(request));
+    TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+                                   (char *) &request, sizeof(request)));
   }
   return 0;
 }
index c7fd9653f2d54bae7417204713fef52b6426ede0..41f53f38efacac8ce3b6ccd101dd760aa01a500b 100644 (file)
@@ -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)));
   }
 }
 
index 721da9b4e7b63c5c09e4f693a76492366e13689e..f87413bc0f7821463295c509766ef9810c5b9d35 100644 (file)
@@ -631,7 +631,8 @@ int __pthread_initialize_manager(void)
     }
   /* Synchronize debugging of the thread manager */
   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)));
   return 0;
 }
 
@@ -653,7 +654,8 @@ int __pthread_create_2_1(pthread_t *thread, const pthread_attr_t *attr,
   request.req_args.create.arg = arg;
   sigprocmask(SIG_SETMASK, (const sigset_t *) NULL,
               &request.req_args.create.mask);
-  __libc_write(__pthread_manager_request, (char *) &request, sizeof(request));
+  TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+                                 (char *) &request, sizeof(request)));
   suspend(self);
   retval = THREAD_GETMEM(self, p_retcode);
   if (__builtin_expect (retval, 0) == 0)
@@ -785,8 +787,8 @@ static void pthread_onexit_process(int retcode, void *arg)
     request.req_thread = self;
     request.req_kind = REQ_PROCESS_EXIT;
     request.req_args.exit.code = retcode;
-    __libc_write(__pthread_manager_request,
-                (char *) &request, sizeof(request));
+    TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+                                   (char *) &request, sizeof(request)));
     suspend(self);
     /* Main thread should accumulate times for thread manager and its
        children, so that timings for main thread account for all threads. */
@@ -1151,7 +1153,7 @@ void __pthread_message(char * fmt, ...)
   va_start(args, fmt);
   vsnprintf(buffer + 8, sizeof(buffer) - 8, fmt, args);
   va_end(args);
-  __libc_write(2, buffer, strlen(buffer));
+  TEMP_FAILURE_RETRY(__libc_write(2, buffer, strlen(buffer)));
 }
 
 #endif
index d3a1450978eeca6220b8ded9d419622d0cebe188..e0dac4120020b911bbd0f47b72d03306d05eb120 100644 (file)
@@ -168,8 +168,8 @@ int __new_sem_post(sem_t * sem)
     }
     request.req_kind = REQ_POST;
     request.req_args.post = sem;
-    __libc_write(__pthread_manager_request,
-                 (char *) &request, sizeof(request));
+    TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+                                   (char *) &request, sizeof(request)));
   }
   return 0;
 }
index ea2d674056a2baebe702188706f5bd5b1bd910e8..d37192243083a97387dcef19a03f7d900d5e28a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -219,10 +219,6 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
          vec[2].iov_base = cp;
          vec[2].iov_len = hst_resp.h_addr_list_cnt * INADDRSZ;
 
-         ignore = alloca (hst_resp.h_addr_list_cnt * IN6ADDRSZ);
-         vec[3].iov_base = ignore;
-         vec[3].iov_len = hst_resp.h_addr_list_cnt * IN6ADDRSZ;
-
          for (cnt = 0; cnt < hst_resp.h_addr_list_cnt; ++cnt)
            {
              resultbuf->h_addr_list[cnt] = cp;
@@ -232,9 +228,9 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
          resultbuf->h_addrtype = AF_INET;
          resultbuf->h_length = INADDRSZ;
 
-         total_len += hst_resp.h_addr_list_cnt * (INADDRSZ + IN6ADDRSZ);
+         total_len += hst_resp.h_addr_list_cnt * INADDRSZ;
 
-         n = 4;
+         n = 3;
        }
       else
        {
This page took 0.0536489999999999 seconds and 5 git commands to generate.