1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-12 09:50:29 +00:00

Added command line flag to enable syslog

This allows -y / --syslog to be used to override -n / --nodaemon disabling it
This commit is contained in:
Katherine Peeters 2022-10-29 21:46:46 -07:00
parent 2debc2e833
commit 8f6d04095b
No known key found for this signature in database
GPG Key ID: D7955C1E39C25B93

View File

@ -142,6 +142,12 @@ main(int argc, const char *argv[])
NGIRCd_Sniffer = true; NGIRCd_Sniffer = true;
ok = true; ok = true;
} }
#endif
#ifdef SYSLOG
if (strcmp(argv[i], "--syslog") == 0) {
NGIRCd_NoSyslog = false;
ok = true;
}
#endif #endif
if (strcmp(argv[i], "--version") == 0) { if (strcmp(argv[i], "--version") == 0) {
Show_Version(); Show_Version();
@ -201,6 +207,12 @@ main(int argc, const char *argv[])
Show_Version(); Show_Version();
exit(1); exit(1);
} }
#ifdef SYSLOG
if (argv[i][n] == 'y') {
NGIRCd_NoSyslog = false;
ok = true;
}
#endif
if (!ok) { if (!ok) {
fprintf(stderr, fprintf(stderr,
@ -479,6 +491,9 @@ Show_Help( void )
#endif #endif
puts( " -t, --configtest read, validate and display configuration; then exit" ); puts( " -t, --configtest read, validate and display configuration; then exit" );
puts( " -V, --version output version information and exit" ); puts( " -V, --version output version information and exit" );
#ifdef SYSLOG
puts( " -y, --syslog log to syslog even when using -n" );
#endif
puts( " -h, --help display this help and exit" ); puts( " -h, --help display this help and exit" );
} /* Show_Help */ } /* Show_Help */