Blame SOURCES/sysstat-10.1.5-int-handler.patch

ab3721
diff -upr sysstat-10.1.5.orig/sadc.c sysstat-10.1.5/sadc.c
ab3721
--- sysstat-10.1.5.orig/sadc.c	2013-03-23 17:31:46.000000000 +0100
ab3721
+++ sysstat-10.1.5/sadc.c	2016-04-29 17:52:11.438614928 +0200
ab3721
@@ -225,17 +225,19 @@ void alarm_handler(int sig)
ab3721
  */
ab3721
 void int_handler(int sig)
ab3721
 {
ab3721
-	if (!optz) {
ab3721
-		/* sadc hasn't been called by sar */
ab3721
+        pid_t ppid = getppid();
ab3721
+
ab3721
+        if (!optz || (ppid == 1)) {
ab3721
+		/* sadc hasn't been called by sar or sar process is already dead */
ab3721
 		exit(1);
ab3721
 	}
ab3721
-	
ab3721
+
ab3721
 	/*
ab3721
 	 * When starting sar then pressing ctrl/c, SIGINT is received
ab3721
 	 * by sadc, not sar. So send SIGINT to sar so that average stats
ab3721
 	 * can be displayed.
ab3721
 	 */
ab3721
-	if (kill(getppid(), SIGINT) < 0) {
ab3721
+	if (kill(ppid, SIGINT) < 0) {
ab3721
 		exit(1);
ab3721
 	}
ab3721
 }