]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 28 Aug 2001 04:52:25 +0000 (04:52 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 28 Aug 2001 04:52:25 +0000 (04:52 +0000)
2001-08-27  Ulrich Drepper  <drepper@redhat.com>

* misc/syslog.c (vsyslog): Try a bit harder to use syslogd.  If
the connection went down after we first used it try to connect
again and resend the message before printing to the console.
Reported by Coserea Gh. Tudor <tudore@tudore.gecadsoftware.com>.

2001-08-27  Jakub Jelinek  <jakub@redhat.com>

* string/tst-strlen.c (main): Test strnlen (, -1) too.
* sysdeps/generic/strnlen.c (__strnlen): Fix for maxlens with top
bit set.

2001-08-27  Ulrich Drepper  <drepper@redhat.com>

* iconv/strtab.c (searchstring): Use correct length for
comparison.
(strtabadd): Account total size correct if new string has old string as
substring.

ChangeLog
iconv/strtab.c
linuxthreads/ChangeLog
linuxthreads/sysdeps/pthread/bits/libc-lock.h
misc/syslog.c
string/tst-strlen.c
sysdeps/generic/strnlen.c

index a4abdeb40ceb2d146bdda2224fa3fa7157c52a30..1d2166270cc0d61a2c2bdccec792b9bd86d77984 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2001-08-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * misc/syslog.c (vsyslog): Try a bit harder to use syslogd.  If
+       the connection went down after we first used it try to connect
+       again and resend the message before printing to the console.
+       Reported by Coserea Gh. Tudor <tudore@tudore.gecadsoftware.com>.
+
+2001-08-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * string/tst-strlen.c (main): Test strnlen (, -1) too.
+       * sysdeps/generic/strnlen.c (__strnlen): Fix for maxlens with top
+       bit set.
+
+2001-08-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * iconv/strtab.c (searchstring): Use correct length for
+       comparison.
+       (strtabadd): Account total size correct if new string has old string as
+       substring.
+
 2001-08-27  Jakub Jelinek  <jakub@redhat.com>
 
        * elf/rtld.c (dl_main): Update call to _dl_lookup_symbol.
index d567f57e8806b56dada4bf3d897915410259d63e..4189f97281a6774e209ed5be54c89b5f5d4eeda6 100644 (file)
@@ -193,7 +193,7 @@ searchstring (struct Strent **sep, struct Strent *newstr)
 
   /* Compare the strings.  */
   cmpres = memcmp ((*sep)->reverse, newstr->reverse,
-                  MIN ((*sep)->len, newstr->len));
+                  MIN ((*sep)->len, newstr->len) - 1);
   if (cmpres == 0)
     /* We found a matching string.  */
     return sep;
@@ -236,10 +236,9 @@ strtabadd (struct Strtab *st, const char *str, size_t len)
          /* When we get here it means that the string we are about to
             add has a common prefix with a string we already have but
             it is longer.  In this case we have to put it first.  */
+         st->total += newstr->len - (*sep)->len;
          newstr->next = *sep;
          *sep = newstr;
-
-         st->total += newstr->len - (*sep)->len;
        }
       else
        {
index 5cbf82783bfa2e8a2b4c5a928f9c8bcd826cc43b..1ce5a23186fa2b4d3ce98e80f07e6c90aaac9767 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_t): Only define to
+       non-opaque type if __USE_UNIX98.
+
 2001-08-26  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/pthread/bits/libc-lock.h (__libc_lock_t): Define
index 02dfc916925134a6f90c2f5608d76a035c0527c8..2c1d1627738cd947e7183ecbc652a35939e329a0 100644 (file)
 /* Mutex type.  */
 #if defined(_LIBC) || defined(_IO_MTSAFE_IO)
 typedef pthread_mutex_t __libc_lock_t;
-typedef pthread_rwlock_t __libc_rwlock_t;
 typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+# ifdef __USE_UNIX98
+typedef pthread_rwlock_t __libc_rwlock_t;
+# else
+typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
+# endif
 #else
 typedef struct __libc_lock_opaque__ __libc_lock_t;
 typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
index 9553c296eaa1facde2150fe49caf9fbc45b73303..58f81996aa5aaa28d926fa7f2ab70b14a8219531 100644 (file)
@@ -239,17 +239,29 @@ vsyslog(pri, fmt, ap)
 
        if (!connected || __send(LogFile, buf, bufsize, 0) < 0)
          {
-           closelog_internal ();       /* attempt re-open next time */
-           /*
-            * Output the message to the console; don't worry about blocking,
-            * if console blocks everything will.  Make sure the error reported
-            * is the one from the syslogd failure.
-            */
-           if (LogStat & LOG_CONS &&
-               (fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
+           if (connected)
              {
-               dprintf (fd, "%s\r\n", buf + msgoff);
-               (void)__close(fd);
+               /* Try to reopen the syslog connection.  Maybe it went
+                  down.  */
+               closelog_internal ();
+               openlog_internal(LogTag, LogStat | LOG_NDELAY, 0);
+             }
+
+           if (!connect || __send(LogFile, buf, bufsize, 0) < 0)
+             {
+               closelog_internal ();   /* attempt re-open next time */
+               /*
+                * Output the message to the console; don't worry
+                * about blocking, if console blocks everything will.
+                * Make sure the error reported is the one from the
+                * syslogd failure.
+                */
+               if (LogStat & LOG_CONS &&
+                   (fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
+                 {
+                   dprintf (fd, "%s\r\n", buf + msgoff);
+                   (void)__close(fd);
+                 }
              }
          }
 
index 1b1f8344b8150b736d2efca0866df42c9f358248..a1e115927b804394169de8aedd4c0019a698141d 100644 (file)
@@ -31,7 +31,8 @@ main(int argc, char *argv[])
              buf[words * 4 + 3] = (last & 8) != 0 ? 'e' : '\0';
              buf[words * 4 + 4] = '\0';
 
-             if (strlen (buf) != words * 4 + lens[last])
+             if (strlen (buf) != words * 4 + lens[last]
+                 || strnlen (buf, -1) != words * 4 + lens[last])
                {
                  printf ("failed for base=%Zu, words=%Zu, and last=%Zu\n",
                          base, words, last);
index f1b6760247a974250bb1af594a33116eb2aa454f..1386acfd9c476f3f42134ae8beaef887971cda7c 100644 (file)
@@ -36,6 +36,9 @@ __strnlen (const char *str, size_t maxlen)
   if (maxlen == 0)
     return 0;
 
+  if (__builtin_expect (end_ptr < str, 0))
+    end_ptr = (const char *) ~0UL;
+
   /* Handle the first few characters by reading one character at a time.
      Do this until CHAR_PTR is aligned on a longword boundary.  */
   for (char_ptr = str; ((unsigned long int) char_ptr