|
|
| version 1.1, 2012/02/21 23:32:47 | version 1.1.1.3, 2019/10/22 13:49:55 |
|---|---|
| Line 249 void | Line 249 void |
| vLogPrintf(const char *fmt, va_list args) | vLogPrintf(const char *fmt, va_list args) |
| { | { |
| if (!SLIST_EMPTY(&gConsole.sessions)) { | if (!SLIST_EMPTY(&gConsole.sessions)) { |
| char buf[256]; | char buf[1000]; |
| ConsoleSession s; | ConsoleSession s; |
| vsnprintf(buf, sizeof(buf), fmt, args); | vsnprintf(buf, sizeof(buf), fmt, args); |
| #ifdef SYSLOG_FACILITY | #ifdef SYSLOG_FACILITY |
| syslog(LOG_INFO, "%s", buf); | syslog(LOG_INFO, "%s", buf); |
| #endif | #endif |
| pthread_cleanup_push(ConsoleCancelCleanup, gConsole.lock); | |
| RWLOCK_RDLOCK(gConsole.lock); | RWLOCK_RDLOCK(gConsole.lock); |
| SLIST_FOREACH(s, &gConsole.sessions, next) { | SLIST_FOREACH(s, &gConsole.sessions, next) { |
| if (Enabled(&s->options, CONSOLE_LOGGING)) | if (Enabled(&s->options, CONSOLE_LOGGING)) |
| s->write(s, "%s\r\n", buf); | s->write(s, "%s\r\n", buf); |
| } | } |
| RWLOCK_UNLOCK(gConsole.lock); | pthread_cleanup_pop(1); |
| #ifdef SYSLOG_FACILITY | #ifdef SYSLOG_FACILITY |
| } else { | } else { |
| vsyslog(LOG_INFO, fmt, args); | vsyslog(LOG_INFO, fmt, args); |