lib/util/time.c - make the "strftime" output locale independant ("%c" is not)
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 22 Dec 2010 08:53:27 +0000 (09:53 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 22 Dec 2010 11:21:16 +0000 (12:21 +0100)
So that it also works on Solaris.

lib/util/time.c

index 7c1532a230afbaee05664334a100d7fcf2debbc4..770ebc43745101a181d4a6464c309242f8dd6969 100644 (file)
@@ -384,11 +384,10 @@ _PUBLIC_ char *timestring(TALLOC_CTX *mem_ctx, time_t t)
        }
 
 #ifdef HAVE_STRFTIME
-       /* some versions of gcc complain about using %c. This is a bug
-          in the gcc warning, not a bug in this code. See a recent
-          strftime() manual page for details.
-        */
-       strftime(tempTime,sizeof(tempTime)-1,"%c %Z",tm);
+       /* Some versions of gcc complain about using some special format
+        * specifiers. This is a bug in gcc, not a bug in this code. See a
+        * recent strftime() manual page for details. */
+       strftime(tempTime,sizeof(tempTime)-1,"%a %b %e %X %Y %Z",tm);
        TimeBuf = talloc_strdup(mem_ctx, tempTime);
 #else
        TimeBuf = talloc_strdup(mem_ctx, asctime(tm));