Blame SOURCES/0002-Drop-an-unused-global-variable.patch

90e381
From d0045e35674d64d166d17c3c079ae03e8c2e6361 Mon Sep 17 00:00:00 2001
90e381
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
90e381
Date: Thu, 13 Feb 2020 17:29:06 +0100
90e381
Subject: [PATCH 2/2] Drop an unused global variable
90e381
90e381
The global variable `s_timezone` is not used anymore, so we can drop
90e381
it.
90e381
---
90e381
 sysutil.c | 17 +++--------------
90e381
 1 file changed, 3 insertions(+), 14 deletions(-)
90e381
90e381
diff --git a/sysutil.c b/sysutil.c
90e381
index 66d4c5e..0ccf551 100644
90e381
--- a/sysutil.c
90e381
+++ b/sysutil.c
90e381
@@ -72,8 +72,6 @@ static struct timeval s_current_time;
90e381
 static int s_current_pid = -1;
90e381
 /* Exit function */
90e381
 static exitfunc_t s_exit_func;
90e381
-/* Difference in timezone from GMT in seconds */
90e381
-static long s_timezone;
90e381
 
90e381
 /* Our internal signal handling implementation details */
90e381
 static struct vsf_sysutil_sig_details
90e381
@@ -2661,7 +2659,6 @@ char* vsf_sysutil_get_tz()
90e381
 void
90e381
 vsf_sysutil_tzset(void)
90e381
 {
90e381
-  int retval;
90e381
   char *tz=NULL, tzbuf[sizeof("+HHMM!")];
90e381
   time_t the_time = time(NULL);
90e381
   struct tm* p_tm;
90e381
@@ -2681,17 +2678,9 @@ vsf_sysutil_tzset(void)
90e381
   {
90e381
     die("localtime");
90e381
   }
90e381
-  retval = strftime(tzbuf, sizeof(tzbuf), "%z", p_tm);
90e381
-  tzbuf[sizeof(tzbuf) - 1] = '\0';
90e381
-  if (retval == 5)
90e381
-  {
90e381
-    s_timezone = ((tzbuf[1] - '0') * 10 + (tzbuf[2] - '0')) * 60 * 60;
90e381
-    s_timezone += ((tzbuf[3] - '0') * 10 + (tzbuf[4] - '0')) * 60;
90e381
-    if (tzbuf[0] == '+')
90e381
-    {
90e381
-      s_timezone *= -1;
90e381
-    }
90e381
-  }
90e381
+  /* Not sure if the following call to strftime() has any desired side
90e381
+     effects, so I'm keeping it to be safe. */
90e381
+  (void) strftime(tzbuf, sizeof(tzbuf), "%z", p_tm);
90e381
   /* Call in to the time subsystem again now that TZ is set, trying to force
90e381
    * caching of the actual zoneinfo for the timezone.
90e381
    */
90e381
-- 
90e381
2.24.1
90e381