FreeBSD Bugzilla – Attachment 208785 Details for
Bug 240517
[PATCH] devel/glib20: syscall flood on every time*() function call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
glib20_tzcache.patch (text/plain), 1.92 KB, created by
Ivan Rozhuk
on 2019-11-02 02:45:58 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Ivan Rozhuk
Created:
2019-11-02 02:45:58 UTC
Size:
1.92 KB
patch
obsolete
>Index: devel/glib20/files/patch-glib_gtimezone.c >=================================================================== >--- devel/glib20/files/patch-glib_gtimezone.c (nonexistent) >+++ devel/glib20/files/patch-glib_gtimezone.c (working copy) >@@ -0,0 +1,66 @@ >+--- glib/gtimezone.c.orig 2018-09-21 12:29:23.000000000 +0300 >++++ glib/gtimezone.c 2019-09-12 00:53:42.760936000 +0300 >+@@ -37,6 +37,7 @@ >+ #include "gslice.h" >+ #include "gdatetime.h" >+ #include "gdate.h" >++#include "genviron.h" >+ >+ #ifdef G_OS_WIN32 >+ #define STRICT >+@@ -187,6 +188,8 @@ struct _GTimeZone >+ >+ G_LOCK_DEFINE_STATIC (time_zones); >+ static GHashTable/*<string?, GTimeZone>*/ *time_zones; >++G_LOCK_DEFINE_STATIC (tz_local); >++static GTimeZone *tz_local = NULL; >+ >+ #define MIN_TZYEAR 1916 /* Daylight Savings started in WWI */ >+ #define MAX_TZYEAR 2999 /* And it's not likely ever to go away, but >+@@ -1457,10 +1460,20 @@ g_time_zone_new (const gchar *identifier) >+ * >+ * Since: 2.26 >+ **/ >++static gpointer >++g_time_zone_utc_init (gpointer data) >++{ >++ return g_time_zone_new ("UTC"); >++} >++ >+ GTimeZone * >+ g_time_zone_new_utc (void) >+ { >+- return g_time_zone_new ("UTC"); >++ static GOnce utc_once = G_ONCE_INIT; >++ >++ g_once (&utc_once, g_time_zone_utc_init, NULL); >++ >++ return g_time_zone_ref ((GTimeZone *)utc_once.retval); >+ } >+ >+ /** >+@@ -1483,7 +1496,23 @@ g_time_zone_new_utc (void) >+ GTimeZone * >+ g_time_zone_new_local (void) >+ { >+- return g_time_zone_new (getenv ("TZ")); >++ const gchar *tzenv = g_getenv ("TZ"); >++ GTimeZone *tz; >++ >++ G_LOCK (tz_local); >++ >++ /* Is time zone changed and must be flushed? */ >++ if (tz_local && g_strcmp0 (tz_local->name, tzenv)) >++ g_clear_pointer (&tz_local, g_time_zone_unref); >++ >++ if (tz_local == NULL) >++ tz_local = g_time_zone_new (tzenv); >++ >++ tz = g_time_zone_ref (tz_local); >++ >++ G_UNLOCK (tz_local); >++ >++ return tz; >+ } >+ >+ #define TRANSITION(n) g_array_index (tz->transitions, Transition, n)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
rozhuk.im
:
maintainer-approval?
Actions:
View
|
Diff
Attachments on
bug 240517
:
207400
|
207403
|
207446
| 208785