]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - tftp/patches/tftp-hpa-0.39-tzfix.patch
tftp: New package.
[people/ms/ipfire-3.x.git] / tftp / patches / tftp-hpa-0.39-tzfix.patch
1 diff -up tftp-hpa-0.49/tftpd/tftpd.c.tzfix tftp-hpa-0.49/tftpd/tftpd.c
2 --- tftp-hpa-0.49/tftpd/tftpd.c.tzfix 2008-10-20 18:08:31.000000000 -0400
3 +++ tftp-hpa-0.49/tftpd/tftpd.c 2008-11-25 11:45:27.000000000 -0500
4 @@ -350,6 +350,14 @@ int main(int argc, char **argv)
5 const char *pidfile = NULL;
6 u_short tp_opcode;
7
8 + time_t my_time = 0;
9 + struct tm* p_tm;
10 + char envtz[10];
11 + my_time = time(NULL);
12 + p_tm = localtime(&my_time);
13 + snprintf(envtz, sizeof(envtz) - 1, "UTC%+d", (p_tm->tm_gmtoff * -1)/3600);
14 + setenv("TZ", envtz, 0);
15 +
16 /* basename() is way too much of a pain from a portability standpoint */
17
18 p = strrchr(argv[0], '/');