Clean up error handling and uses of TRUE/FALSE.
authorMatt Kraai <kraai@debian.org>
Wed, 25 Oct 2000 16:40:21 +0000 (16:40 -0000)
committerMatt Kraai <kraai@debian.org>
Wed, 25 Oct 2000 16:40:21 +0000 (16:40 -0000)
logger.c
sysklogd/logger.c

index fa1cf6d15e2c023f33e553ae00387adcf13253de..bd9eed9f6555fa67323e36024eb1dc00ae6f164b 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -80,19 +80,15 @@ static int pencode(char *s)
        if (*s) {
                *s = '\0';
                fac = decode(save, facilitynames);
-               if (fac < 0) {
-                       errorMsg("unknown facility name: %s\n", save);
-                       exit(FALSE);
-               }
+               if (fac < 0)
+                       fatalError("unknown facility name: %s\n", save);
                *s++ = '.';
        } else {
                s = save;
        }
        lev = decode(s, prioritynames);
-       if (lev < 0) {
-               errorMsg("unknown priority name: %s\n", save);
-               exit(FALSE);
-       }
+       if (lev < 0)
+               fatalError("unknown priority name: %s\n", save);
        return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
 }
 
@@ -149,17 +145,15 @@ extern int logger_main(int argc, char **argv)
                }
                message = buf;
        } else {
-               if (argc >= 1) {
+               if (argc >= 1)
                        message = *argv;
-               } else {
-                       errorMsg("No message\n");
-                       exit(FALSE);
-               }
+               else
+                       fatalError("No message\n");
        }
 
        openlog(name, option, (pri | LOG_FACMASK));
        syslog(pri, message);
        closelog();
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index fa1cf6d15e2c023f33e553ae00387adcf13253de..bd9eed9f6555fa67323e36024eb1dc00ae6f164b 100644 (file)
@@ -80,19 +80,15 @@ static int pencode(char *s)
        if (*s) {
                *s = '\0';
                fac = decode(save, facilitynames);
-               if (fac < 0) {
-                       errorMsg("unknown facility name: %s\n", save);
-                       exit(FALSE);
-               }
+               if (fac < 0)
+                       fatalError("unknown facility name: %s\n", save);
                *s++ = '.';
        } else {
                s = save;
        }
        lev = decode(s, prioritynames);
-       if (lev < 0) {
-               errorMsg("unknown priority name: %s\n", save);
-               exit(FALSE);
-       }
+       if (lev < 0)
+               fatalError("unknown priority name: %s\n", save);
        return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
 }
 
@@ -149,17 +145,15 @@ extern int logger_main(int argc, char **argv)
                }
                message = buf;
        } else {
-               if (argc >= 1) {
+               if (argc >= 1)
                        message = *argv;
-               } else {
-                       errorMsg("No message\n");
-                       exit(FALSE);
-               }
+               else
+                       fatalError("No message\n");
        }
 
        openlog(name, option, (pri | LOG_FACMASK));
        syslog(pri, message);
        closelog();
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }