- show localtime instead of GMT (#172274)

This commit is contained in:
Radek Vokál 2006-04-10 16:13:43 +00:00
parent 29ec29ab8b
commit 3567b1b402
2 changed files with 24 additions and 1 deletions

18
tftp-hpa-0.39-tzfix.patch Normal file
View File

@ -0,0 +1,18 @@
--- 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], '/');

View File

@ -3,12 +3,13 @@
Summary: The client for the Trivial File Transfer Protocol (TFTP).
Name: tftp
Version: %{tftp_hpa_version}
Release: 2
Release: 3
License: BSD
Group: Applications/Internet
Source0: http://www.kernel.org/pub/software/network/tftp/tftp-hpa-%{tftp_hpa_version}.tar.gz
Patch0: tftp-0.40-remap.patch
Patch1: tftp-hpa-0.42-sigjmp.patch
Patch2: tftp-hpa-0.39-tzfix.patch
BuildPreReq: tcp_wrappers
BuildRoot: %{_tmppath}/%{name}-root
@ -36,6 +37,7 @@ enabled unless it is expressly needed. The TFTP server is run from
%setup -q -n tftp-hpa-%{version}
%patch0 -p1 -b .zero
%patch1 -p1 -b .sigjmp
%patch2 -p1 -b .tzfix
%build
@ -78,6 +80,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man8/*
%changelog
* Mon Apr 10 2006 Radek Vokál <rvokal@redhat.com> 0.42-3
- show localtime instead of GMT (#172274)
* Wed Mar 22 2006 Radek Vokál <rvokal@redhat.com> 0.42-2
- fix double free error when hitting ^C (#186201)