summaryrefslogtreecommitdiffstats
path: root/runtime/stpd/librelay.c
diff options
context:
space:
mode:
authortrz <trz>2005-06-27 21:44:34 +0000
committertrz <trz>2005-06-27 21:44:34 +0000
commit6f7d62667fe95bf7df0c40ad7f8ba7c34cc4a1f1 (patch)
tree09941050d38fe8c12d38f41b632917de1a93083a /runtime/stpd/librelay.c
parent07aa4b3863b5bf4a8c62f7dab767ecfd8ebecfc2 (diff)
downloadsystemtap-steved-6f7d62667fe95bf7df0c40ad7f8ba7c34cc4a1f1.tar.gz
systemtap-steved-6f7d62667fe95bf7df0c40ad7f8ba7c34cc4a1f1.tar.xz
systemtap-steved-6f7d62667fe95bf7df0c40ad7f8ba7c34cc4a1f1.zip
double rmmod fix
Diffstat (limited to 'runtime/stpd/librelay.c')
-rw-r--r--runtime/stpd/librelay.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/stpd/librelay.c b/runtime/stpd/librelay.c
index 60a513b7..67e62df8 100644
--- a/runtime/stpd/librelay.c
+++ b/runtime/stpd/librelay.c
@@ -619,6 +619,8 @@ static void postprocess_and_exit(void)
delete_percpu_files();
}
+ close(control_channel);
+
exit(0);
}
@@ -705,8 +707,12 @@ int stp_main_loop(void)
fputs ((char *)ptr, stdout);
break;
case STP_EXIT:
- if (!streaming() && !exiting) {
- exiting = 1;
+ if (exiting)
+ break;
+
+ exiting = 1;
+
+ if (!streaming()) {
kill_percpu_threads(ncpus);
if (request_last_buffers() < 0)
exit(1);
@@ -728,7 +734,6 @@ int stp_main_loop(void)
if (!streaming() && (final_cpus_processed < ncpus))
break;
- close(control_channel);
postprocess_and_exit();
break;
default: