diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-05-11 02:23:29 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-05-11 02:23:29 +0400 |
commit | 7a54471e59ad598e296cffed4f0f72ad94a62f41 (patch) | |
tree | 2f608295e43e7a41dfb7238a5231e7573ed2cf8b | |
parent | bcfc193cbb4edb108d15c67f6550905c1689d216 (diff) | |
download | inetutils-7a54471e59ad598e296cffed4f0f72ad94a62f41.tar.gz |
Use POSIX signal functions
-rw-r--r-- | debian/patches/no-bsd-signals.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/debian/patches/no-bsd-signals.patch b/debian/patches/no-bsd-signals.patch new file mode 100644 index 0000000..6cd17b6 --- /dev/null +++ b/debian/patches/no-bsd-signals.patch @@ -0,0 +1,60 @@ +Index: inetutils/libinetutils/kcmd.c +=================================================================== +--- inetutils.orig/libinetutils/kcmd.c 2011-12-31 19:02:32.000000000 +0400 ++++ inetutils/libinetutils/kcmd.c 2013-05-11 01:48:02.914288646 +0400 +@@ -100,7 +100,7 @@ + # endif + { + int s, timo = 1, pid; +- long oldmask; ++ sigset_t oldmask, newmask; + struct sockaddr_in sin, from; + char c; + +@@ -136,7 +136,9 @@ + realm = krb_realmofhost (host_save); + # endif /* KERBEROS */ + +- oldmask = sigblock (sigmask (SIGURG)); ++ sigemptyset(&newmask); ++ sigaddset(&newmask, SIGURG); ++ sigprocmask(SIG_BLOCK, &newmask, &oldmask); + for (;;) + { + s = getport (&lport); +@@ -146,7 +148,7 @@ + fprintf (stderr, "kcmd(socket): All ports in use\n"); + else + perror ("kcmd: socket"); +- sigsetmask (oldmask); ++ sigprocmask(SIG_BLOCK, &oldmask, NULL); + return (-1); + } + fcntl (s, F_SETOWN, pid); +@@ -189,7 +191,7 @@ + # endif /* !(defined(ultrix) || defined(sun)) */ + if (errno != ECONNREFUSED) + perror (hp->h_name); +- sigsetmask (oldmask); ++ sigprocmask(SIG_BLOCK, &oldmask, NULL); + + return (-1); + } +@@ -320,7 +322,7 @@ + status = -1; + goto bad2; + } +- sigsetmask (oldmask); ++ sigprocmask(SIG_BLOCK, &oldmask, NULL); + *sock = s; + # if defined KERBEROS + return (KSUCCESS); +@@ -332,7 +334,7 @@ + close (*fd2p); + bad: + close (s); +- sigsetmask (oldmask); ++ sigprocmask(SIG_BLOCK, &oldmask, NULL); + return (status); + } + |