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); }