This caused the linked list of appenders to loop on itself, creating
an infinite logging loop in `__lxc_log_append`.
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
lxc_log_category_lxc.appender = &log_appender_syslog;
return 0;
}
+
+ appender = lxc_log_category_lxc.appender;
+ /* Check if syslog was already added, to avoid creating a loop */
+ while (appender) {
+ if (appender == &log_appender_syslog) {
+ /* not an error: openlog re-opened the connection */
+ return 0;
+ }
+ appender = appender->next;
+ }
+
appender = lxc_log_category_lxc.appender;
while (appender->next != NULL)
appender = appender->next;