From 65c4534198b928113481eaef5c2de3e5b3d8cf7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Sun, 7 Sep 2008 18:10:36 +0200 Subject: - Debug to stderr instead of debug.txt --- include/debug.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/debug.h b/include/debug.h index 350a27e..18c891e 100644 --- a/include/debug.h +++ b/include/debug.h @@ -23,17 +23,15 @@ #ifdef DEBUGGING +# include # include # define DEBUGPATH "debug.txt" extern pthread_mutex_t __debug_lock__; -FILE *__debug_handle__; # define DEBUG(...) do { \ - pthread_mutex_lock(&__debug_lock__); \ - __debug_handle__ = fopen(DEBUGPATH, "a"); \ - fprintf (__debug_handle__, __VA_ARGS__); \ - fclose(__debug_handle__); \ - pthread_mutex_unlock(&__debug_lock__); \ - } while (0) + pthread_mutex_lock(&__debug_lock__); \ + fprintf (stderr, __VA_ARGS__); \ + pthread_mutex_unlock(&__debug_lock__); \ + } while (0) #else # define DEBUG(...) #endif -- cgit v1.2.3