diff options
author | Chris Hall (GMCH) <chris.hall@highwayman.com> | 2009-12-10 21:29:13 +0000 |
---|---|---|
committer | Chris Hall (GMCH) <chris.hall@highwayman.com> | 2009-12-10 21:29:13 +0000 |
commit | 224a85d77aea7077ce7aec038d7abe3bb3b049ea (patch) | |
tree | 9cfad7112b2bbc78982f62fda99a85093d1421e3 /lib/log.c | |
parent | 3f41e4bfc9c17a17b425c1872ef99ddcc42e3e28 (diff) | |
parent | 7f6da094bad38e3593e475a81a28f1833d911c46 (diff) | |
download | quagga-224a85d77aea7077ce7aec038d7abe3bb3b049ea.tar.bz2 quagga-224a85d77aea7077ce7aec038d7abe3bb3b049ea.tar.xz |
Merge branch 'pthreads' of /git/quagga.euro-ix into pthreads
Diffstat (limited to 'lib/log.c')
-rw-r--r-- | lib/log.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -42,6 +42,7 @@ #else #define LOCK qpt_mutex_lock(vty_mutex);++vty_lock_count; #define UNLOCK --vty_lock_count;qpt_mutex_unlock(vty_mutex); +#define ASSERTLOCKED if(vty_lock_count==0 && !vty_lock_asserted){vty_lock_asserted=1;assert(0);} #endif /* log is protected by the same mutext as vty, see comments in vty.c */ @@ -194,7 +195,7 @@ uvzlog (struct zlog *zl, int priority, const char *format, va_list args) struct timestamp_control tsctl; tsctl.already_rendered = 0; - assert(vty_lock_count); + ASSERTLOCKED /* If zlog is not specified, use default one. */ if (zl == NULL) @@ -721,6 +722,11 @@ _zlog_abort_err (const char *mess, int err, const char *file, static void zlog_abort (const char *mess) { +#ifndef NDEBUG + /* don't work about being unlocked */ + vty_lock_asserted = 1; +#endif + /* Force fallback file logging? */ if (zlog_default && !zlog_default->fp && ((logfile_fd = open_crashlog()) >= 0) && @@ -1357,3 +1363,4 @@ proto_name2num(const char *s) #undef LOCK #undef UNLOCK +#undef ASSERTLOCKED |