Fix for sigaction
authorRoland Schulz <roland@utk.edu>
Fri, 27 Apr 2012 04:09:17 +0000 (00:09 -0400)
committerRoland Schulz <roland@utk.edu>
Fri, 27 Apr 2012 04:09:17 +0000 (00:09 -0400)
Commit "Restart IO operations when interrupter by signal"
didn't actually activate sigaction because config.h.cmakein
change was missing.

Fixes #798

Change-Id: Id5c7e3344688c32ec4c51d84ccbc66658ed928f9

src/config.h.cmakein
src/gmxlib/sighandler.c

index dc02217adb9e6ddc359de3d5c92a73f68f7a506f..a2af355c6db2d9ac0ec1b3a08089fb1fd6ad88e7 100644 (file)
 /* Define to 1 if you have the lstat() function. */
 #cmakedefine HAVE_LSTAT
 
+/* Define to 1 if you have the sigaction() function. */
+#cmakedefine HAVE_SIGACTION
+
 /* Define to 1 if you have the <string.h> header file. */
 #cmakedefine HAVE_STRING_H
 
index 71115b7478dfd6eaf2b6d7a692e904b9b959abae..7c9496a78c5e9b485d00467260fd222f5dfae203 100644 (file)
@@ -102,8 +102,8 @@ static void gmx_signal(int signum)
 #ifdef HAVE_SIGACTION
     struct sigaction act;
     act.sa_handler = signal_handler;
-    act.flags = SA_RESTART;
-    sigaction(signum,act);
+    act.sa_flags = SA_RESTART;
+    sigaction(signum,&act,NULL);
 #else
     signal(signum,signal_handler);
 #endif