]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 14 Dec 2001 07:02:23 +0000 (07:02 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 14 Dec 2001 07:02:23 +0000 (07:02 +0000)
2001-12-13  Thorsten Kukuk  <kukuk@suse.de>

* sysdeps/posix/cuserid.c (cuserid): If we don't find the UID,
but have a user supplied buffer, return the empty buffer, not NULL.

ChangeLog
linuxthreads/specific.c
sysdeps/posix/cuserid.c

index 95418042926129629076145c24b459d06682e9ac..95e10239af251ab743c3bf20938966e71bc4d0c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-13  Thorsten Kukuk  <kukuk@suse.de>
+
+       * sysdeps/posix/cuserid.c (cuserid): If we don't find the UID,
+       but have a user supplied buffer, return the empty buffer, not NULL.
+
 2001-12-13  Ulrich Drepper  <drepper@redhat.com>
 
        * crypt/md5.c (md5_process_bytes): Correct handling of alignment.
index 1a0cab10b687d05fbee49cab2344717366185137..2dbf2055e592b4e6d8ff61f2ca71c601a714824a 100644 (file)
@@ -102,25 +102,28 @@ int pthread_key_delete(pthread_key_t key)
 
   /* Set the value of the key to NULL in all running threads, so
      that if the key is reallocated later by pthread_key_create, its
-     associated values will be NULL in all threads. */
+     associated values will be NULL in all threads.
 
-  {
-    struct pthread_key_delete_helper_args args;
-    struct pthread_request request;
+     Do nothing if no threads have been created yet.  */
 
-    args.idx1st = key / PTHREAD_KEY_2NDLEVEL_SIZE;
-    args.idx2nd = key % PTHREAD_KEY_2NDLEVEL_SIZE;
-    args.self = 0;
+  if (__pthread_manager_request != -1)
+    {
+      struct pthread_key_delete_helper_args args;
+      struct pthread_request request;
 
-    request.req_thread = self;
-    request.req_kind = REQ_FOR_EACH_THREAD;
-    request.req_args.for_each.arg = &args;
-    request.req_args.for_each.fn = pthread_key_delete_helper;
+      args.idx1st = key / PTHREAD_KEY_2NDLEVEL_SIZE;
+      args.idx2nd = key % PTHREAD_KEY_2NDLEVEL_SIZE;
+      args.self = 0;
 
-    TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
-                                   (char *) &request, sizeof(request)));
-    suspend(self);
-  }
+      request.req_thread = self;
+      request.req_kind = REQ_FOR_EACH_THREAD;
+      request.req_args.for_each.arg = &args;
+      request.req_args.for_each.fn = pthread_key_delete_helper;
+
+      TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+                                     (char *) &request, sizeof(request)));
+      suspend(self);
+    }
 
   pthread_mutex_unlock(&pthread_keys_mutex);
   return 0;
index 3417d0a695847a452874c98ae139811e97a3a129..11c827a6868743088855f200684965c6d286c85c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -39,7 +39,7 @@ cuserid (s)
     {
       if (s != NULL)
        s[0] = '\0';
-      return NULL;
+      return s;
     }
 
   if (s == NULL)