summaryrefslogtreecommitdiff
path: root/debian/patches/no-bsd-signals.patch
blob: 6cd17b647f569ddece90038ec0fcae505d46234e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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);
 }