changeset 183:960764fbc68f

Fix compilation error
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 04 Feb 2010 16:22:55 +0900
parents 9ed2e3ce4434
children 89d39bcf9ef5
files include/freeDiameter/libfreeDiameter.h libfreeDiameter/log.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/include/freeDiameter/libfreeDiameter.h	Thu Feb 04 16:19:52 2010 +0900
+++ b/include/freeDiameter/libfreeDiameter.h	Thu Feb 04 16:22:55 2010 +0900
@@ -189,7 +189,8 @@
 
 /* Helper for debugging by adding traces -- for debuging a specific location of the code */
 #define TRACE_HERE()	\
-	TRACE_DEBUG(NONE, " -- debug checkpoint -- ");
+	TRACE_DEBUG(NONE, " -- debug checkpoint %d -- ", fd_breakhere());
+int fd_breakhere(void);
 
 /* Helper for tracing the CHECK_* macros bellow -- very very verbose code execution! */
 #define TRACE_DEBUG_ALL( str ) 	\
@@ -477,7 +478,6 @@
 /* Terminate a thread */
 static __inline__ int fd_thr_term(pthread_t * th)
 {
-	int ret = 0;
 	void * th_ret = NULL;
 	
 	CHECK_PARAMS(th);
@@ -490,7 +490,7 @@
 	(void) pthread_cancel(*th);
 	
 	/* Then join the thread */
-	CHECK_POSIX_DO( ret = pthread_join(*th, &th_ret), /* continue */ );
+	CHECK_POSIX( pthread_join(*th, &th_ret) );
 	
 	if (th_ret == PTHREAD_CANCELED) {
 		TRACE_DEBUG(ANNOYING, "The thread %p was canceled", *th);
@@ -501,7 +501,7 @@
 	/* Clean the location */
 	*th = (pthread_t)NULL;
 	
-	return ret;
+	return 0;
 }
 
 /* Cleanups for cancellation (all threads should be safely cancelable...) */
--- a/libfreeDiameter/log.c	Thu Feb 04 16:19:52 2010 +0900
+++ b/libfreeDiameter/log.c	Thu Feb 04 16:22:55 2010 +0900
@@ -45,6 +45,9 @@
 char * fd_debug_one_function = NULL;
 char * fd_debug_one_file = NULL;
 
+/* Useless function, only to ease setting up a breakpoint in gdb (break fd_breakhere) -- use TRACE_HERE */
+int fd_breaks = 0;
+int fd_breakhere(void) { return ++fd_breaks; }
 
 /* Log a debug message */
 void fd_log_debug ( char * format, ... )
"Welcome to our mercurial repository"