[Xfce4-commits] r25881 - in libxfcegui4/branches/xfce_4_4: . libxfcegui4

Nick Schermer nick at xfce.org
Wed Jul 4 10:58:50 CEST 2007


Author: nick
Date: 2007-07-04 08:58:49 +0000 (Wed, 04 Jul 2007)
New Revision: 25881

Modified:
   libxfcegui4/branches/xfce_4_4/ChangeLog
   libxfcegui4/branches/xfce_4_4/NEWS
   libxfcegui4/branches/xfce_4_4/configure.in.in
   libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce_clock.c
Log:
	* Revert my previous commit. Using localtime_r in some other code
	  this way was able to segfault the application, so this is not 
	  suitable for the 4.4 branch.

Modified: libxfcegui4/branches/xfce_4_4/ChangeLog
===================================================================
--- libxfcegui4/branches/xfce_4_4/ChangeLog	2007-07-04 07:04:44 UTC (rev 25880)
+++ libxfcegui4/branches/xfce_4_4/ChangeLog	2007-07-04 08:58:49 UTC (rev 25881)
@@ -1,3 +1,9 @@
+2007-07-03 10:55  nick
+
+	* Revert my previous commit. Using localtime_r in some other code
+	  this way was able to segfault the application, so this is not 
+	  suitable for the 4.4 branch.
+
 2007-07-02 10:34  nick
 
         * NEWS, configure.in.in, libxfcegui4/xfce_clock.c: Use localtime_r

Modified: libxfcegui4/branches/xfce_4_4/NEWS
===================================================================
--- libxfcegui4/branches/xfce_4_4/NEWS	2007-07-04 07:04:44 UTC (rev 25880)
+++ libxfcegui4/branches/xfce_4_4/NEWS	2007-07-04 08:58:49 UTC (rev 25881)
@@ -3,7 +3,6 @@
 - Allocate a copy of passed cliend id, program name and working directory
   in session management, in case the application frees the data.
 - Properly deal with %-starting 'field codes' in commands from .desktop files
-- Use localtime_r when available.
 
 4.4.1
 =====

Modified: libxfcegui4/branches/xfce_4_4/configure.in.in
===================================================================
--- libxfcegui4/branches/xfce_4_4/configure.in.in	2007-07-04 07:04:44 UTC (rev 25880)
+++ libxfcegui4/branches/xfce_4_4/configure.in.in	2007-07-04 08:58:49 UTC (rev 25881)
@@ -80,7 +80,7 @@
 dnl ************************************************
 AC_STDC_HEADERS()
 AC_CHECK_HEADERS([fcntl.h limits.h stdarg.h stddef.h time.h varargs.h])
-AC_CHECK_FUNCS([setsid localtime_r])
+AC_CHECK_FUNCS([setsid])
 
 dnl ******************************
 dnl *** Check for i18n support ***
@@ -111,7 +111,7 @@
 dnl *** Check for gtk-doc ***
 dnl *************************
 GTK_DOC_CHECK([1.0])
-
+                                                                                
 dnl ***********************************
 dnl *** Check for debugging support ***
 dnl ***********************************

Modified: libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce_clock.c
===================================================================
--- libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce_clock.c	2007-07-04 07:04:44 UTC (rev 25880)
+++ libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce_clock.c	2007-07-04 08:58:49 UTC (rev 25881)
@@ -386,19 +386,10 @@
 {
     time_t ticks;
     struct tm *tm;
-#ifdef HAVE_LOCALTIME_R
-    struct tm  tmbuf;
-#endif
     gint h, m, s;
 
     ticks = time (0);
-
-#ifdef HAVE_LOCALTIME_R
-    tm = localtime_r (&ticks, &tmbuf);
-#else
     tm = localtime (&ticks);
-#endif
-
     h = tm->tm_hour;
     m = tm->tm_min;
     s = tm->tm_sec;
@@ -751,11 +742,6 @@
     gchar buffer[256];
     XfceClock *clock;
     guint ln = 0;
-    time_t ticks;
-    struct tm *tm;
-#ifdef HAVE_LOCALTIME_R
-    struct tm  tmbuf;
-#endif
     guint width = 0;
     guint height = 0;
     PangoLayout *layout = NULL;
@@ -771,15 +757,10 @@
         case XFCE_CLOCK_DIGITAL:
             if (clock->show_formatted)
             {
-                ticks = time (0);
+                time_t ticks = time (0);
+                struct tm *tm = localtime (&ticks);
 
-#ifdef HAVE_LOCALTIME_R
-                tm = localtime_r (&ticks, &tmbuf);
-#else
-                tm = localtime (&ticks);
-#endif
-
-                xfce_clock_format_time_to_utf8 (buffer, sizeof(buffer),
+                xfce_clock_format_time_to_utf8 (buffer, sizeof(buffer), 
                                                 clock->format_string, tm);
             }
             else if (clock->military_time)
@@ -1076,9 +1057,6 @@
     XfceClock *clock;
     time_t ticks;
     struct tm *tm;
-#ifdef HAVE_LOCALTIME_R
-    struct tm  tmbuf;
-#endif
     gint h, m, s;
     gint x, y;
     gchar ampm[3] = "AM";
@@ -1092,13 +1070,7 @@
     clock = XFCE_CLOCK (widget);
 
     ticks = time (0);
-
-#ifdef HAVE_LOCALTIME_R
-    tm = localtime_r (&ticks, &tmbuf);
-#else
     tm = localtime (&ticks);
-#endif
-
     h = tm->tm_hour;
     m = tm->tm_min;
     s = tm->tm_sec;
@@ -1117,7 +1089,7 @@
     }
 
     if ((clock->show_formatted) &&
-        (clock->format_string != NULL) &&
+        (clock->format_string != NULL) && 
         (strlen (clock->format_string) != 0))
     {
         xfce_clock_format_time_to_utf8 (time_buf, sizeof(time_buf), clock->format_string, tm);
@@ -1241,8 +1213,8 @@
                                widget->allocation.height);
     }
 
-    /*
-     * Here we decide arbitrary that if the clock widget is smaller than
+    /* 
+     * Here we decide arbitrary that if the clock widget is smaller than 
      * 20 pixels, we don't draw the shadow.
      */
     if (MIN (xc, yc) >= 20)
@@ -1289,9 +1261,6 @@
     XfceClock *clock;
     time_t ticks;
     struct tm *tm;
-#ifdef HAVE_LOCALTIME_R
-    struct tm  tmbuf;
-#endif
     gint h, m, s;
     gint x, y;
     guint c_width = 0;
@@ -1307,13 +1276,7 @@
     clock = XFCE_CLOCK (widget);
 
     ticks = time (0);
-
-#ifdef HAVE_LOCALTIME_R
-    tm = localtime_r (&ticks, &tmbuf);
-#else
     tm = localtime (&ticks);
-#endif
-
     h = tm->tm_hour;
     m = tm->tm_min;
     s = tm->tm_sec;
@@ -1498,22 +1461,13 @@
 {
     time_t ticks;
     struct tm *tm;
-#ifdef HAVE_LOCALTIME_R
-    struct tm  tmbuf;
-#endif
     gint h, m, s;
 
     g_return_val_if_fail (clock != NULL, FALSE);
     g_return_val_if_fail (XFCE_IS_CLOCK (clock), FALSE);
 
     ticks = time (0);
-
-#ifdef HAVE_LOCALTIME_R
-    tm = localtime_r (&ticks, &tmbuf);
-#else
     tm = localtime (&ticks);
-#endif
-
     h = tm->tm_hour;
     m = tm->tm_min;
     s = tm->tm_sec;



More information about the Xfce4-commits mailing list