Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-11-14 16:07:40 -0500
committerEugene Tarassov2011-11-14 16:07:40 -0500
commit3e513d6057e50f027f97ab86f5a21e13b1569691 (patch)
tree887ed5ff28ce33b316f3825575d4f853c8f85922
parentea912ebc8332c6b009d195dc28c45e0e83c9b460 (diff)
downloadorg.eclipse.tcf.agent-3e513d6057e50f027f97ab86f5a21e13b1569691.tar.gz
org.eclipse.tcf.agent-3e513d6057e50f027f97ab86f5a21e13b1569691.tar.xz
org.eclipse.tcf.agent-3e513d6057e50f027f97ab86f5a21e13b1569691.zip
TCF Agent: added conditional compilation statements to build the agent without signal handlers: ENABLE_SignalHandlers=0
-rw-r--r--agent/tcf/main/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/agent/tcf/main/main.c b/agent/tcf/main/main.c
index dbf9d625..ab148115 100644
--- a/agent/tcf/main/main.c
+++ b/agent/tcf/main/main.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
@@ -36,8 +36,14 @@
#include <tcf/main/services.h>
#include <tcf/main/server.h>
+#ifndef ENABLE_SignalHandlers
+# define ENABLE_SignalHandlers 1
+#endif
+
static const char * progname;
+#if ENABLE_SignalHandlers
+
static void shutdown_event(void * args) {
discovery_stop();
cancel_event_loop();
@@ -68,6 +74,8 @@ static BOOL CtrlHandler(DWORD ctrl) {
}
#endif
+#endif /* ENABLE_SignalHandlers */
+
#if !defined(_WRS_KERNEL)
static const char * help_text[] = {
"Usage: agent [OPTION]...",
@@ -234,14 +242,15 @@ int main(int argc, char ** argv) {
}
discovery_start();
+#if ENABLE_SignalHandlers
signal(SIGABRT, signal_handler);
signal(SIGILL, signal_handler);
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
-
#if defined(WIN32)
SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE);
#endif
+#endif /* ENABLE_SignalHandlers */
/* Process events - must run on the initial thread since ptrace()
* returns ECHILD otherwise, thinking we are not the owner. */

Back to the top