Skip to content
Snippets Groups Projects
Commit 83f0f857 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Support an optional log identifier to syslog()

Nelgin: "anyway to get sexpots to report itself differently to syslog" [?]
parent 3d405a93
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,7 @@ int usage(const char* fname)
"\n-enable enable NT service (auto-start during boot)"
"\n-disable disable NT service"
#else
"\n-syslog log to syslog rather than stdout/err"
"\n-syslog[=ident] log to syslog rather than stdout/err"
#endif
"\n"
,getfname(fname)
......@@ -1509,7 +1509,7 @@ service_loop(int argc, char** argv)
}
else if(stricmp(arg,"help")==0 || *arg=='?')
exit(usage(argv[0]));
else if(stricmp(arg,"syslog") != 0) {
else if(stricmp(arg,"syslog") != 0 && strnicmp(arg,"syslog=",7) != 0) {
fprintf(stderr,"Invalid option: %s\n", arg);
exit(usage(argv[0]));
}
......@@ -1688,6 +1688,10 @@ int main(int argc, char** argv)
#else
else if(stricmp(arg,"syslog")==0)
daemonize=TRUE;
else if(strnicmp(arg,"syslog=", 7)==0) {
daemonize=TRUE;
openlog(arg+7, LOG_CONS, LOG_USER);
}
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment