gnutls-2.4.2: Get rid of siginterrupt () call.
authorKhem Raj <raj.khem@gmail.com>
Fri, 6 Mar 2009 00:32:00 +0000 (16:32 -0800)
committerKhem Raj <raj.khem@gmail.com>
Fri, 6 Mar 2009 00:32:00 +0000 (16:32 -0800)
util-linux-ng-2.14: Ditto
* siginterrupt () is SUSV4 function which is
better to be replaced by sigaction as suggested
by standard. Below is from http://www.opengroup.org/onlinepubs/9699919799/
The siginterrupt() function supports programs written to historical system
interfaces. Applications should use the sigaction() with the SA_RESTART
flag instead of the obsolescent siginterrupt() function.

packages/gnutls/gnutls-2.4.2/gnutls-replace-siginterrupt.patch [new file with mode: 0644]
packages/gnutls/gnutls_2.4.2.bb
packages/util-linux-ng/util-linux-ng-2.14/util-linux-ng-replace-siginterrupt.patch [new file with mode: 0644]
packages/util-linux-ng/util-linux-ng_2.14.bb

diff --git a/packages/gnutls/gnutls-2.4.2/gnutls-replace-siginterrupt.patch b/packages/gnutls/gnutls-2.4.2/gnutls-replace-siginterrupt.patch
new file mode 100644 (file)
index 0000000..9b734a9
--- /dev/null
@@ -0,0 +1,37 @@
+Index: gnutls-2.4.2/src/tests.c
+===================================================================
+--- gnutls-2.4.2.orig/src/tests.c      2008-09-15 13:04:19.000000000 -0700
++++ gnutls-2.4.2/src/tests.c   2009-03-04 15:25:09.000000000 -0800
+@@ -491,6 +491,7 @@
+   int old, secs = 6;
+ #ifndef _WIN32
++  struct sigaction act;
+   signal (SIGALRM, got_alarm);
+ #endif
+@@ -511,7 +512,9 @@
+     return TEST_FAILED;
+ #ifndef _WIN32
+-  old = siginterrupt (SIGALRM, 1);
++  (void) sigaction(SIGALRM, NULL, &act);
++  act.sa_flags &= ~SA_RESTART;
++  old = sigaction(SIGALRM, &act, NULL);
+   alarm (secs);
+ #else
+   setsockopt ((int)gnutls_transport_get_ptr (session), SOL_SOCKET, SO_RCVTIMEO,
+@@ -525,7 +528,12 @@
+   while (ret > 0);
+ #ifndef _WIN32
+-  siginterrupt (SIGALRM, old);
++  (void) sigaction(SIGALRM, NULL, &act);
++  if (old)
++    act.sa_flags &= ~SA_RESTART;
++  else
++    act.sa_flags |= SA_RESTART;
++  sigaction(SIGALRM, &act, NULL);
+ #else
+   if (WSAGetLastError () == WSAETIMEDOUT ||
+       WSAGetLastError () == WSAECONNABORTED)
index ddaef1d..d33e687 100644 (file)
@@ -4,6 +4,7 @@ SRC_URI += "\
        file://gnutls-openssl.patch;patch=1 \
        file://gnutls-texinfo-euro.patch;patch=1 \
        file://configure_madness.patch;patch=1 \
+       file://gnutls-replace-siginterrupt.patch;patch=1 \
        "
 
-PR = "r3"
+PR = "r4"
diff --git a/packages/util-linux-ng/util-linux-ng-2.14/util-linux-ng-replace-siginterrupt.patch b/packages/util-linux-ng/util-linux-ng-2.14/util-linux-ng-replace-siginterrupt.patch
new file mode 100644 (file)
index 0000000..4b5eb73
--- /dev/null
@@ -0,0 +1,23 @@
+Index: util-linux-ng-2.14/login-utils/login.c
+===================================================================
+--- util-linux-ng-2.14.orig/login-utils/login.c        2008-05-28 16:01:02.000000000 -0700
++++ util-linux-ng-2.14/login-utils/login.c     2009-03-04 18:31:42.000000000 -0800
+@@ -358,6 +358,7 @@
+     char *childArgv[10];
+     char *buff;
+     int childArgc = 0;
++    struct sigaction act;
+ #ifdef HAVE_SECURITY_PAM_MISC_H
+     int retcode;
+     pam_handle_t *pamh = NULL;
+@@ -373,7 +374,9 @@
+     pid = getpid();
+     signal(SIGALRM, timedout);
+-    siginterrupt(SIGALRM,1);           /* we have to interrupt syscalls like ioclt() */
++    (void) sigaction(SIGALRM, NULL, &act);
++    act.sa_flags &= ~SA_RESTART;
++    sigaction(SIGALRM, &act, NULL);
+     alarm((unsigned int)timeout);
+     signal(SIGQUIT, SIG_IGN);
+     signal(SIGINT, SIG_IGN);
index 1223aa7..587eb97 100644 (file)
@@ -1,9 +1,10 @@
 require util-linux-ng.inc
 
-PR = "r3"
+PR = "r4"
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/util-linux-ng-2.14', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
 
 SRC_URI += "file://util-linux-ng-uclibc-versionsort.patch;patch=1 \
+           file://util-linux-ng-replace-siginterrupt.patch;patch=1 \
           "
 LDFLAGS_append_linux-uclibc = " -lintl"
 LDFLAGS_append_linux-uclibcgnueabi = " -lintl "