From 7e120e33881a13d870e2ee299ec426edb1aeb29b Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 25 Jun 2008 16:49:13 +0000 Subject: [PATCH] Don't register the hook more than once. --- src/makeBaseApp/top/exampleApp/src/initTrace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/makeBaseApp/top/exampleApp/src/initTrace.c b/src/makeBaseApp/top/exampleApp/src/initTrace.c index 48d8c8319..50bc8e8c7 100644 --- a/src/makeBaseApp/top/exampleApp/src/initTrace.c +++ b/src/makeBaseApp/top/exampleApp/src/initTrace.c @@ -17,6 +17,11 @@ static void trace(initHookState state) { } int traceIocInit(void) { + static int done = 0; + if (done) + return -1; + done = 1; + initHookRegister(trace); puts("iocInit will be traced"); return 0;