Browse Source

[trac558] Fix minor platform-dependent issues

Fixes two issues:
1. src/lib/log/Makefile.am referenced a now-deleted file - this
   caused issues building the logging code on some platforms.
2. The message compiler used ctime_r(), which causes a problem on
   Solaris, which implements a non POSIX-compliant version (it has
   a third argument).  As the compiler is not multi-threaded, it
   was replaced with a call to ctime().
Stephen Morris 14 years ago
parent
commit
90980c5054
2 changed files with 3 additions and 6 deletions
  1. 1 1
      src/lib/log/Makefile.am
  2. 2 5
      src/lib/log/compiler/message.cc

+ 1 - 1
src/lib/log/Makefile.am

@@ -10,7 +10,7 @@ CLEANFILES = *.gcno *.gcda
 lib_LTLIBRARIES = liblog.la
 liblog_la_SOURCES  =
 liblog_la_SOURCES += dbglevels.h
-liblog_la_SOURCES += dummylog.h dummylog.cc Message.h
+liblog_la_SOURCES += dummylog.h dummylog.cc
 liblog_la_SOURCES += filename.h filename.cc
 liblog_la_SOURCES += logger.cc logger.h
 liblog_la_SOURCES += logger_support.cc logger_support.h

+ 2 - 5
src/lib/log/compiler/message.cc

@@ -101,13 +101,10 @@ static void usage() {
 
 static string currentTime() {
 
-    // Get the current time.
+    // Get a text representation of the current time.
     time_t curtime;
     time(&curtime);
-
-    // Format it
-    char buffer[32];
-    ctime_r(&curtime, buffer);
+    char* buffer = ctime(&curtime);
 
     // Convert to string and strip out the trailing newline
     string current_time = buffer;