about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKatherine Peeters <katherine.peeters@leagueh.xyz>2022-10-29 21:46:46 -0700
committerKatherine Peeters <katherine.peeters@leagueh.xyz>2022-10-29 21:46:46 -0700
commit8f6d04095be35a9d0ff5b9375a61ddc243b6c83c (patch)
tree4a057838e7861057ec070db7cf3a56e32ee13087
parent2debc2e833836c99710553837e30210009818ed7 (diff)
downloadngircd-8f6d04095be35a9d0ff5b9375a61ddc243b6c83c.tar.gz
ngircd-8f6d04095be35a9d0ff5b9375a61ddc243b6c83c.zip
Added command line flag to enable syslog
This allows -y / --syslog to be used to override -n / --nodaemon disabling it
-rw-r--r--src/ngircd/ngircd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 9f77f302..398c75c0 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -143,6 +143,12 @@ main(int argc, const char *argv[])
 				ok = true;
 			}
 #endif
+#ifdef SYSLOG
+			if (strcmp(argv[i], "--syslog") == 0) {
+				NGIRCd_NoSyslog = false;
+				ok = true;
+			}
+#endif
 			if (strcmp(argv[i], "--version") == 0) {
 				Show_Version();
 				exit(0);
@@ -201,6 +207,12 @@ main(int argc, const char *argv[])
 					Show_Version();
 					exit(1);
 				}
+#ifdef SYSLOG
+				if (argv[i][n] == 'y') {
+					NGIRCd_NoSyslog = false;
+					ok = true;
+				}
+#endif
 
 				if (!ok) {
 					fprintf(stderr,
@@ -479,6 +491,9 @@ Show_Help( void )
 #endif
 	puts( "  -t, --configtest   read, validate and display configuration; then 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" );
 } /* Show_Help */