Blame SOURCES/rhbz1365550.patch

9201c6
commit 10c48d46fa482b8cc762592aaee6c7cc178356e7
9201c6
Author: Frank Ch. Eigler <fche@redhat.com>
9201c6
Date:   Mon Mar 28 08:54:11 2016 -0400
9201c6
9201c6
    PR19874: reset 60s alarm for "stap -c CMD"
9201c6
    
9201c6
    Brown paper bag bug.  Test case included.
9201c6
9201c6
diff --git a/staprun/mainloop.c b/staprun/mainloop.c
9201c6
index 82c0c74..874fbd8 100644
9201c6
--- a/staprun/mainloop.c
9201c6
+++ b/staprun/mainloop.c
9201c6
@@ -281,6 +281,7 @@ void start_cmd(void)
9201c6
     raise (SIGCONT); /* Harmless; just passes control to parent. */
9201c6
 #endif /* !WORKAROUND_BZ467568 */
9201c6
 
9201c6
+    alarm(0); /* clear alarms */
9201c6
     dbug(1, "execing target_cmd %s\n", target_cmd);
9201c6
 
9201c6
     /* Note that execvp() is not a direct system call; it does a $PATH
9201c6
diff --git a/testsuite/systemtap.base/staprunwait.exp b/testsuite/systemtap.base/staprunwait.exp
9201c6
new file mode 100644
9201c6
index 0000000..fc71973
9201c6
--- /dev/null
9201c6
+++ b/testsuite/systemtap.base/staprunwait.exp
9201c6
@@ -0,0 +1,17 @@
9201c6
+set test staprunwait
9201c6
+
9201c6
+if {! [installtest_p]} { untested $test; return }
9201c6
+    
9201c6
+foreach runtime [get_runtime_list] {
9201c6
+    if {$runtime != ""} {
9201c6
+        set ok [catch {exec stap $srcdir/$subdir/$test.stp --runtime=$runtime -c "sleep 120"} foo]
9201c6
+    } else {
9201c6
+        set ok [catch {exec stap $srcdir/$subdir/$test.stp -c "sleep 120"} foo]
9201c6
+    }
9201c6
+    verbose -log "$ok $foo"
9201c6
+    if {$ok != 0} {
9201c6
+        fail "$test $runtime"
9201c6
+    } else {
9201c6
+        pass "$test $runtime"
9201c6
+    }
9201c6
+}
9201c6
diff --git a/testsuite/systemtap.base/staprunwait.stp b/testsuite/systemtap.base/staprunwait.stp
9201c6
new file mode 100644
9201c6
index 0000000..91cbc92
9201c6
--- /dev/null
9201c6
+++ b/testsuite/systemtap.base/staprunwait.stp
9201c6
@@ -0,0 +1,3 @@
9201c6
+#! /usr/bin/env stap
9201c6
+
9201c6
+probe timer.s(10) { println(ctime()) }