summaryrefslogtreecommitdiffstats
path: root/runtime/stpd/librelay.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-08-24 16:27:35 +0000
committerhunt <hunt>2005-08-24 16:27:35 +0000
commit8140a0fdec3e8c131bdc1007d856acb8ae758abc (patch)
tree20d8df6455cfab7de2c21fff48ac480cccf83f23 /runtime/stpd/librelay.c
parentbc1ea08b028ee36a19538b144fa45f20b558008b (diff)
downloadsystemtap-steved-8140a0fdec3e8c131bdc1007d856acb8ae758abc.tar.gz
systemtap-steved-8140a0fdec3e8c131bdc1007d856acb8ae758abc.tar.xz
systemtap-steved-8140a0fdec3e8c131bdc1007d856acb8ae758abc.zip
2005-08-24 Martin Hunt <hunt@redhat.com>
* librelay.c (sigproc): Reestablish signal handler so impatient people don't hit ^C twice and terminate the program before it saves the data and removes the module. Also print a message to stderr that it is exiting. (stp_main_loop): Write OOB data (warnings, errors, etc) to stderr instead of stdout. * librelay.h: Write debug info to stderr. * Makefile: add librelay.h to dependencies.
Diffstat (limited to 'runtime/stpd/librelay.c')
-rw-r--r--runtime/stpd/librelay.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/stpd/librelay.c b/runtime/stpd/librelay.c
index f3bf2a9f..7191c0a5 100644
--- a/runtime/stpd/librelay.c
+++ b/runtime/stpd/librelay.c
@@ -590,6 +590,9 @@ static void cleanup_and_exit (int closed)
static void sigproc(int signum __attribute__((unused)))
{
+ signal(SIGINT, sigproc);
+ signal(SIGTERM, sigproc);
+ fprintf(stderr, "Exiting...\n");
send_request(STP_EXIT, NULL, 0);
}
@@ -656,6 +659,9 @@ int stp_main_loop(void)
case STP_REALTIME_DATA:
fputs ((char *)data, stdout);
break;
+ case STP_OOB_DATA:
+ fputs ((char *)data, stderr);
+ break;
case STP_EXIT:
{
/* module asks us to unload it and exit */