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.10-376-ge0f471a


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  e0f471a1187cdfcb029c80819da52b4c12e352f5 (commit)
      from  d79eccd6dd8aa2038a9775689a7072fe3ceb40dc (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=e0f471a1187cdfcb029c80819da52b4c12e352f5

commit e0f471a1187cdfcb029c80819da52b4c12e352f5
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu Oct 29 13:45:10 2009 -0700

    Print timestamp in nscd debug messages.

diff --git a/ChangeLog b/ChangeLog
index c46e962..b673fd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-29  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #10742]
+	* nscd/dbg_log.c (dbg_log): Print timestamp before the message text.
+	Based on patch by Jeffrey Bastian <jbastian@redhat.com>.
+
 2009-10-27  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/unix/sysv/linux/getpt.c (__posix_openpt): Make sure
diff --git a/nscd/dbg_log.c b/nscd/dbg_log.c
index 5e192c9..fa99dac 100644
--- a/nscd/dbg_log.c
+++ b/nscd/dbg_log.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 2000, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 2000, 2004, 2005, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
 
@@ -53,14 +53,23 @@ void
 dbg_log (const char *fmt,...)
 {
   va_list ap;
-  char msg[512], msg2[512];
+  char msg2[512];
 
   va_start (ap, fmt);
-  vsnprintf (msg2, sizeof (msg), fmt, ap);
+  vsnprintf (msg2, sizeof (msg2), fmt, ap);
 
   if (debug_level > 0)
     {
-      snprintf (msg, sizeof (msg), "%d: %s%s", getpid (), msg2,
+      time_t t = time (NULL);
+
+      struct tm now;
+      localtime_r (&t, &now);
+
+      char buf[256];
+      strftime (buf, sizeof (buf), "%c", &now);
+
+      char msg[512];
+      snprintf (msg, sizeof (msg), "%s - %d: %s%s", buf, getpid (), msg2,
 		msg2[strlen (msg2) - 1] == '\n' ? "" : "\n");
       if (dbgout)
 	{

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

Summary of changes:
 ChangeLog      |    6 ++++++
 nscd/dbg_log.c |   17 +++++++++++++----
 2 files changed, 19 insertions(+), 4 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]