2002-08-16 Jakub Jelinek <jakub@redhat.com>
authorRoland McGrath <roland@gnu.org>
Fri, 16 Aug 2002 00:08:47 +0000 (00:08 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 16 Aug 2002 00:08:47 +0000 (00:08 +0000)
        * locale/loadarchive.c (_nl_load_locale_from_archive): Braino fix
in change before last: MAX -> MIN.

ChangeLog
linuxthreads/ChangeLog
linuxthreads/sysdeps/i386/tls.h
locale/loadarchive.c

index e54d260..addf8f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-16  Jakub Jelinek  <jakub@redhat.com>
+
+        * locale/loadarchive.c (_nl_load_locale_from_archive): Braino fix
+       in change before last: MAX -> MIN.
+
 2002-08-15  Roland McGrath  <roland@redhat.com>
 
        * libio/fileops.c (_IO_file_seekoff_mmap): Leave read pointers at EOF
index 67be250..cd529e8 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-15  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/i386/tls.h (TLS_INIT_TP): Use statement expression and
+       return a value as callers now expect.
+
 2002-08-11  Roland McGrath  <roland@redhat.com>
 
        * pthread.c (__pthread_initialize_manager): Initialize
index 03d36de..3e7e4c3 100644 (file)
@@ -122,8 +122,8 @@ typedef struct
 /* Code to initially initialize the thread pointer.  This might need
    special attention since 'errno' is not yet available and if the
    operation can cause a failure 'errno' must not be touched.  */
-#  define TLS_INIT_TP(descr) \
-  do {                                                                       \
+#  define TLS_INIT_TP(descr)                                                 \
+  ({                                                                         \
     void *_descr = (descr);                                                  \
     tcbhead_t *head = _descr;                                                \
     int __gs;                                                                \
@@ -133,11 +133,13 @@ typedef struct
     head->self = _descr;                                                     \
                                                                              \
     __gs = TLS_SETUP_GS_SEGMENT (_descr);                                    \
-    if (__builtin_expect (__gs, 7) == -1)                                    \
-      /* Nothing else we can do.  */                                         \
-      asm ("hlt");                                                           \
-    asm ("movw %w0, %%gs" : : "q" (__gs));                                   \
-  } while (0)
+    if (__builtin_expect (__gs, 7) != -1)                                    \
+      {                                                                              \
+       asm ("movw %w0, %%gs" : : "q" (__gs));                                \
+       __gs = 0;                                                             \
+      }                                                                              \
+    __gs;                                                                    \
+  })
 
 
 /* Return the address of the dtv for the current thread.  */
index d71ec88..c795971 100644 (file)
@@ -206,7 +206,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
         just map the whole file and be sure everything is covered.  */
 
       mapsize = (sizeof (void *) > 4 ? archive_stat.st_size
-                : MAX (archive_stat.st_size, ARCHIVE_MAPPING_WINDOW));
+                : MIN (archive_stat.st_size, ARCHIVE_MAPPING_WINDOW));
 
       result = __mmap64 (NULL, mapsize, PROT_READ, MAP_SHARED, fd, 0);
       if (result == MAP_FAILED)