]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/main.c
Import CUPS 1.4svn r7023 into easysw/current.
[thirdparty/cups.git] / scheduler / main.c
index 6b4d83993387b2c8edf59ab0ffcf15d36529b280..9cb8439bbe4c663ca79d4d0c94a00a920a01b69a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: main.c 6915 2007-09-05 21:05:17Z mike $"
+ * "$Id: main.c 6914 2007-09-05 21:05:04Z mike $"
  *
  *   Scheduler main loop for the Common UNIX Printing System (CUPS).
  *
@@ -254,6 +254,11 @@ main(int  argc,                            /* I - Number of command-line args */
              fg             = 1;
              break;
 
+          case 't' : /* Test the cupsd.conf file... */
+             TestConfigFile = 1;
+             fg             = 1;
+             break;
+
          default : /* Unknown option */
               _cupsLangPrintf(stderr, _("cupsd: Unknown option \"%c\" - "
                                        "aborting!\n"), *opt);
@@ -410,10 +415,18 @@ main(int  argc,                           /* I - Number of command-line args */
 
   if (!cupsdReadConfiguration())
   {
-    syslog(LOG_LPR, "Unable to read configuration file \'%s\' - exiting!",
-           ConfigurationFile);
+    if (TestConfigFile)
+      printf("%s contains errors\n", ConfigurationFile);
+    else
+      syslog(LOG_LPR, "Unable to read configuration file \'%s\' - exiting!",
+            ConfigurationFile);
     return (1);
   }
+  else if (TestConfigFile)
+  {
+    printf("%s is OK\n", ConfigurationFile);
+    return (0);
+  }
 
   if (!strncmp(TempDir, RequestRoot, strlen(RequestRoot)))
   {
@@ -1892,5 +1905,5 @@ usage(int status)                 /* O - Exit status */
 
 
 /*
- * End of "$Id: main.c 6915 2007-09-05 21:05:17Z mike $".
+ * End of "$Id: main.c 6914 2007-09-05 21:05:04Z mike $".
  */