From 29ccfbea89be3d218d5fcee35fd0ee9a670afd73 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 10 Feb 2015 13:12:00 +0100 Subject: [PATCH] Copy /etc/localtime instead of making a symlink This way we inherit timezone updates from the host at least for the current timezone. --- xdg-app-session-helper.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/xdg-app-session-helper.c b/xdg-app-session-helper.c index 46ff806b..54183c53 100644 --- a/xdg-app-session-helper.c +++ b/xdg-app-session-helper.c @@ -66,36 +66,8 @@ copy_file (const char *source, gchar *contents = NULL; gsize len; - if (g_file_test (source, G_FILE_TEST_IS_SYMLINK)) - { - contents = g_file_read_link (source, NULL); - if (contents) - { - unlink (dest); - - if (strcmp (source, "/etc/localtime") == 0) - { - char *zoneinfo = g_strrstr (contents, "zoneinfo/"); - char *new_contents; - - if (zoneinfo) - { - new_contents = g_build_filename ("/usr/share/zoneinfo", zoneinfo + strlen ("zoneinfo/"), NULL); - g_free (contents); - contents = new_contents; - } - } - - symlink (contents, dest); - } - } - else - { - if (g_file_get_contents (source, &contents, &len, NULL)) - { - g_file_set_contents (dest, contents, len, NULL); - } - } + if (g_file_get_contents (source, &contents, &len, NULL)) + g_file_set_contents (dest, contents, len, NULL); g_free (basename); g_free (dest);