Florian Weimer 2023-02-05 18:12:13 +01:00
parent 144580b4ee
commit cf7519f2da
2 changed files with 56 additions and 1 deletions

50
tftp-c99.patch Normal file
View File

@ -0,0 +1,50 @@
The glibc headers do not declare bsd_signal by default. Call signal
instead, which is the same function as bsd_signal in current glibc.
This fixes implicit function declarations and avoids build issues with
future compilers.
diff --git a/tftp/main.c b/tftp/main.c
index fcf5a25ac654954b..7e399d414ca0dd2b 100644
--- a/tftp/main.c
+++ b/tftp/main.c
@@ -310,7 +310,7 @@ int main(int argc, char *argv[])
sp->s_proto = (char *)"udp";
}
- bsd_signal(SIGINT, intr);
+ signal(SIGINT, intr);
if (peerargc) {
/* Set peer */
@@ -791,7 +791,7 @@ void intr(int sig)
{
(void)sig; /* Quiet unused warning */
- bsd_signal(SIGALRM, SIG_IGN);
+ signal(SIGALRM, SIG_IGN);
alarm(0);
siglongjmp(toplevel, -1);
}
diff --git a/tftp/tftp.c b/tftp/tftp.c
index 109848c4f9a5ad4e..d31553be5b76e305 100644
--- a/tftp/tftp.c
+++ b/tftp/tftp.c
@@ -85,7 +85,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode)
is_request = 1; /* First packet is the actual WRQ */
amount = 0;
- bsd_signal(SIGALRM, timer);
+ signal(SIGALRM, timer);
do {
if (is_request) {
size = makerequest(WRQ, name, dp, mode) - 4;
@@ -191,7 +191,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode)
firsttrip = 1;
amount = 0;
- bsd_signal(SIGALRM, timer);
+ signal(SIGALRM, timer);
do {
if (firsttrip) {
size = makerequest(RRQ, name, ap, mode);

View File

@ -3,7 +3,7 @@
Summary: The client for the Trivial File Transfer Protocol (TFTP)
Name: tftp
Version: 5.2
Release: 38%{?dist}
Release: 39%{?dist}
License: BSD
URL: http://www.kernel.org/pub/software/network/tftp/
Source0: http://www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-%{version}.tar.bz2
@ -22,6 +22,7 @@ Patch9: tftp-doc.patch
Patch10: tftp-enhanced-logging.patch
Patch11: tftp-hpa-5.2-gcc10.patch
Patch12: tftp-off-by-one.patch
Patch13: tftp-c99.patch
BuildRequires: autoconf
BuildRequires: gcc
@ -64,6 +65,7 @@ systemd socket activation, and is disabled by default.
%patch10 -p1 -b .logging
%patch11 -p1 -b .gcc10
%patch12 -p1 -b .off-by-one
%patch13 -p1
%build
autoreconf
@ -105,6 +107,9 @@ install -p -m 644 %SOURCE2 ${RPM_BUILD_ROOT}%{_unitdir}
%{_unitdir}/*
%changelog
* Sun Feb 05 2023 Florian Weimer <fweimer@redhat.com> - 5.2-39
- Fix C99 compatibility issue (#2148911)
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-38
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild