summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai2000-10-25 16:40:21 +0000
committerMatt Kraai2000-10-25 16:40:21 +0000
commit3180413e7643dcb9ae38a617bf531557f64b3c57 (patch)
tree142d6fd6c020d30bc3d7895072edb1ddc9a8600e
parentac1169b20f31f00f9ccec1957b3be3215a4e6a21 (diff)
downloadbusybox-3180413e7643dcb9ae38a617bf531557f64b3c57.zip
busybox-3180413e7643dcb9ae38a617bf531557f64b3c57.tar.gz
Clean up error handling and uses of TRUE/FALSE.
-rw-r--r--logger.c22
-rw-r--r--sysklogd/logger.c22
2 files changed, 16 insertions, 28 deletions
diff --git a/logger.c b/logger.c
index fa1cf6d..bd9eed9 100644
--- 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;
}
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index fa1cf6d..bd9eed9 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/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;
}