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