From 6f7d62667fe95bf7df0c40ad7f8ba7c34cc4a1f1 Mon Sep 17 00:00:00 2001 From: trz Date: Mon, 27 Jun 2005 21:44:34 +0000 Subject: [PATCH] double rmmod fix --- runtime/stpd/librelay.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/runtime/stpd/librelay.c b/runtime/stpd/librelay.c index 60a513b75..67e62df8f 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: -- 2.43.5