This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.14-572-g60e8585


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  60e8585f2a2aa288a403a581f1dc8d3fc373598b (commit)
      from  8fa26d571d4b87a1c7a7f19f1365f7e5d2995933 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=60e8585f2a2aa288a403a581f1dc8d3fc373598b

commit 60e8585f2a2aa288a403a581f1dc8d3fc373598b
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Wed Dec 21 19:26:29 2011 -0500

    Fix reading thread name from comm file

diff --git a/NEWS b/NEWS
index e40ce3f..aba4a8d 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,7 @@ Version 2.15
   12885, 12892, 12907, 12922, 12935, 13007, 13021, 13067, 13068, 13090,
   13092, 13114, 13118, 13123, 13134, 13138, 13147, 13150, 13179, 13192,
   13268, 13276, 13291, 13335, 13337, 13344, 13358, 13367, 13439, 13446,
-  13472, 13484, 13506, 13524
+  13472, 13484, 13506, 13515, 13524
 
 * New program pldd to list loaded object of a process
   Implemented by Ulrich Drepper.
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index b622fe7..31177bf 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-21  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #13515]
+	* sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
+	Correct reading name from file.
+
 2011-12-14  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* allocatestack.c (allocate_stack): Return errno on failure.
diff --git a/nptl/sysdeps/unix/sysv/linux/pthread_getname.c b/nptl/sysdeps/unix/sysv/linux/pthread_getname.c
index 6e7786f..2c5ee63 100644
--- a/nptl/sysdeps/unix/sysv/linux/pthread_getname.c
+++ b/nptl/sysdeps/unix/sysv/linux/pthread_getname.c
@@ -1,5 +1,5 @@
 /* pthread_getname_np -- Get  thread name.  Linux version
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 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
@@ -57,6 +57,15 @@ pthread_getname_np (th, buf, len)
   ssize_t n = TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, len));
   if (n < 0)
     res = errno;
+  else
+    {
+      if (buf[n - 1] == '\n')
+	buf[n - 1] = '\0';
+      else if (n == len)
+	res = ERANGE;
+      else
+	buf[n] = '\0';
+    }
 
   close_not_cancel_no_status (fd);
 

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                           |    2 +-
 nptl/ChangeLog                                 |    6 ++++++
 nptl/sysdeps/unix/sysv/linux/pthread_getname.c |   11 ++++++++++-
 3 files changed, 17 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]