]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Added command line flag to enable syslog
authorKatherine Peeters <katherine.peeters@leagueh.xyz>
Sun, 30 Oct 2022 04:46:46 +0000 (21:46 -0700)
committerKatherine Peeters <katherine.peeters@leagueh.xyz>
Sun, 30 Oct 2022 04:46:46 +0000 (21:46 -0700)
This allows -y / --syslog to be used to override -n / --nodaemon disabling it

src/ngircd/ngircd.c

index 9f77f302db49c608c0bbb28893cb64f7c0d845f1..398c75c01f58b04a838048b72088401c59085659 100644 (file)
@@ -142,6 +142,12 @@ main(int argc, const char *argv[])
                                NGIRCd_Sniffer = true;
                                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();
@@ -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 */