Fix issue with oprofile example - signal_parent.c
authorjlance <jlance@9a892ef4-8035-4e6e-bfcf-8e83c02283af>
Tue, 22 Nov 2011 17:45:12 +0000 (17:45 +0000)
committerjlance <jlance@9a892ef4-8035-4e6e-bfcf-8e83c02283af>
Tue, 22 Nov 2011 17:45:12 +0000 (17:45 +0000)
oprofile_example/signal_parent.c

index 7cd55a0c83e9d9f567f9fcceaf97763933a4aa68..5b91683886467c3e9e879e72ea58e01a9e660e35 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <unistd.h> 
 
-static int signal_parent = 0;
+volatile static int signal_parent = 0;
 
 void mysig(int sig)
 {
@@ -33,7 +33,7 @@ int main()
 {
     int pid;
 
-    printf("child signals parent application starting\n");
+    printf("child process starting\n");
 
     if((pid = fork()) == 0) {
     // Child process
@@ -52,7 +52,7 @@ int main()
     do
     {
 #ifdef USE_SIGNALS
-        printf("Parent blocks and waits for child\n");
+        printf("Parent blocks and waits for signal from child\n");
         pause(); // Wait for any signal call
 #endif
     } while(!signal_parent);