lzaoral / rpms / tftp

Forked from rpms/tftp 2 years ago
Clone
Blob Blame History Raw
--- tftp-hpa-0.39/tftpd/tftpd.c.old	2004-09-15 00:38:46.000000000 +0200
+++ tftp-hpa-0.39/tftpd/tftpd.c	2006-04-10 17:26:31.000000000 +0200
@@ -286,7 +286,14 @@
   char *rewrite_file = NULL;
 #endif
   u_short tp_opcode;
-
+  time_t my_time = 0;
+  struct tm* p_tm;
+  char envtz[10];
+  my_time = time(NULL);
+  p_tm = localtime(&my_time);
+  snprintf(envtz, sizeof(envtz) - 1, "UTC%+d", (p_tm->tm_gmtoff * -1)/3600);
+  setenv("TZ", envtz, 0);
+  
   /* basename() is way too much of a pain from a portability standpoint */
 
   p = strrchr(argv[0], '/');