X-Git-Url: https://rtime.felk.cvut.cz/gitweb/coffee/mt-apps.git/blobdiff_plain/f75a57f37770949aa1643a20fe47a56b85393ba3..2bd9a9a1931973c56c69a5c250e972e653581e00:/mt_server.c diff --git a/mt_server.c b/mt_server.c index 7abac68..c683c75 100644 --- a/mt_server.c +++ b/mt_server.c @@ -1,6 +1,9 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include #include #include #include +#include #include "mt_server.h" #include "signal_exit.h" @@ -245,6 +248,7 @@ static void fd_cb(EV_P_ ev_io *w_, int revents) mt_blank_wake(); #endif *pos = 0; + syslog(LOG_INFO, w->text); char *line = new_line(); if (line) { if (list_add(w->lines, w->text) == 0) { @@ -269,6 +273,8 @@ int mt_server_init(mt_server_t *self, struct ev_loop *loop, int fd) return -1; } + openlog(program_invocation_short_name, LOG_PID | LOG_PERROR, LOG_DAEMON); + memset(&info, 0, sizeof(info)); info.port = HTTP_PORT; info.mounts = &mount; @@ -308,6 +314,7 @@ void mt_server_deinit(mt_server_t *self) free_line(self->fd_watcher.text); list_deinit(self->fd_watcher.lines); lws_context_destroy(self->context); + closelog(); } #ifndef NO_MAIN