* we need to re-evaluate the condition every time
* pthread_cond_timedwait returns. */
rc = 0;
- while (!timeout_reached(rf->rf_next_read) && rc == 0) {
+ while ((read_loop != 0)
+ && !timeout_reached(rf->rf_next_read)
+ && rc == 0)
+ {
rc = pthread_cond_timedwait (&read_cond, &read_lock,
&rf->rf_next_read);
}
- /* Must hold `real_lock' when accessing `rf->rf_type'. */
+ /* Must hold `read_lock' when accessing `rf->rf_type'. */
rf_type = rf->rf_type;
pthread_mutex_unlock (&read_lock);
va_list ap;
llentry_t *le;
- if (list_log == NULL)
- {
- va_start (ap, format);
- vfprintf (stderr, format, ap);
- va_end (ap);
- return;
- }
-
#if !COLLECT_DEBUG
if (level >= LOG_DEBUG)
return;
msg[sizeof (msg) - 1] = '\0';
va_end (ap);
+ if (list_log == NULL)
+ {
+ fprintf (stderr, "%s\n", msg);
+ return;
+ }
+
le = llist_head (list_log);
while (le != NULL)
{