mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 11:44:48 +00:00
ttyd: log to syslog
Signed-off-by: Richard Yu <yurichard3839@gmail.com>
This commit is contained in:
20
utils/ttyd/patches/100-log-to-syslog.patch
Normal file
20
utils/ttyd/patches/100-log-to-syslog.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
--- a/src/server.c
|
||||
+++ b/src/server.c
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <syslog.h>
|
||||
|
||||
#include <libwebsockets.h>
|
||||
#include <json.h>
|
||||
@@ -418,7 +419,8 @@ main(int argc, char **argv) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
- lws_set_log_level(debug_level, NULL);
|
||||
+ openlog("ttyd", LOG_NDELAY | LOG_PID, LOG_DAEMON);
|
||||
+ lws_set_log_level(debug_level, lwsl_emit_syslog);
|
||||
|
||||
#if LWS_LIBRARY_VERSION_MAJOR >= 2
|
||||
char server_hdr[128] = "";
|
||||
Reference in New Issue
Block a user