Skip to content
Snippets Groups Projects
Unverified Commit cbb01713 authored by Pablo Correa Gomez's avatar Pablo Correa Gomez
Browse files

timedated: add helper macro ZONEINFODIR

Since it's already used twice, and will be used more in the next commits.
parent 89fbcd37
Branches main
No related tags found
No related merge requests found
......@@ -51,6 +51,8 @@ static GFile *hwclock_file = NULL;
static GFile *timezone_file = NULL;
static GFile *localtime_file = NULL;
#define ZONEINFODIR DATADIR "/zoneinfo"
gboolean local_rtc = FALSE;
gchar *timezone_name = NULL;
G_LOCK_DEFINE_STATIC (clock);
......@@ -95,7 +97,7 @@ get_timezone_name (GError **error)
/* Log if /etc/localtime is not up to date */
localtime_filename = g_file_get_path (localtime_file);
localtime2_filename = g_strdup_printf (DATADIR "/zoneinfo/%s", ret);
localtime2_filename = g_strdup_printf (ZONEINFODIR "/%s", ret);
localtime2_file = g_file_new_for_path (localtime2_filename);
if (!g_file_load_contents (localtime_file, NULL, &filebuf, NULL, NULL, error)) {
......@@ -140,7 +142,7 @@ set_timezone (const gchar *_timezone_name,
}
localtime_filename = g_file_get_path (localtime_file);
localtime2_filename = g_strdup_printf (DATADIR "/zoneinfo/%s", _timezone_name);
localtime2_filename = g_strdup_printf (ZONEINFODIR "/%s", _timezone_name);
localtime2_file = g_file_new_for_path (localtime2_filename);
if (g_file_test(localtime_filename, G_FILE_TEST_IS_SYMLINK)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment