Fix C99 compatibility issue (#2148911)
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
144580b4ee
commit
cf7519f2da
50
tftp-c99.patch
Normal file
50
tftp-c99.patch
Normal 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);
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user