Major coreutils update.
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 4132eb6..b76a52f 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -136,12 +136,12 @@
switch (opt) {
case 'c':
if ((optarg == NULL) || (optarg[1] != '\0')) {
- show_usage();
+ bb_show_usage();
}
/* Valid levels are between 1 and 8 */
console_log_level = *optarg - '1';
if (console_log_level > 7) {
- show_usage();
+ bb_show_usage();
}
console_log_level++;
@@ -150,16 +150,16 @@
doFork = FALSE;
break;
default:
- show_usage();
+ bb_show_usage();
}
}
if (doFork) {
#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (daemon(0, 1) < 0)
- perror_msg_and_die("daemon");
+ bb_perror_msg_and_die("daemon");
#else
- error_msg_and_die("daemon not supported");
+ bb_error_msg_and_die("daemon not supported");
#endif
}
doKlogd(console_log_level);
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index bb63975..1b55bf5 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -89,14 +89,14 @@
*s = '\0';
fac = decode(save, facilitynames);
if (fac < 0)
- error_msg_and_die("unknown facility name: %s", save);
+ bb_error_msg_and_die("unknown facility name: %s", save);
*s++ = '.';
} else {
s = save;
}
lev = decode(s, prioritynames);
if (lev < 0)
- error_msg_and_die("unknown priority name: %s", save);
+ bb_error_msg_and_die("unknown priority name: %s", save);
return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
}
@@ -124,7 +124,7 @@
safe_strncpy(name, optarg, sizeof(name));
break;
default:
- show_usage();
+ bb_show_usage();
}
}
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index ecdf2f5..ae8dbae 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -87,7 +87,7 @@
/* no options, no getopt */
if (argc > 1)
- show_usage();
+ bb_show_usage();
// handle intrrupt signal
if (setjmp(jmp_env)) goto output_end;
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 1c58a64..b912f5f 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -123,7 +123,7 @@
static inline void sem_up(int semid)
{
if (semop(semid, SMwup, 1) == -1) {
- perror_msg_and_die("semop[SMwup]");
+ bb_perror_msg_and_die("semop[SMwup]");
}
}
@@ -133,7 +133,7 @@
static inline void sem_down(int semid)
{
if (semop(semid, SMwdn, 3) == -1) {
- perror_msg_and_die("semop[SMwdn]");
+ bb_perror_msg_and_die("semop[SMwdn]");
}
}
@@ -157,11 +157,11 @@
{
if (buf == NULL) {
if ((shmid = shmget(KEY_ID, shm_size, IPC_CREAT | 1023)) == -1) {
- perror_msg_and_die("shmget");
+ bb_perror_msg_and_die("shmget");
}
if ((buf = shmat(shmid, NULL, 0)) == NULL) {
- perror_msg_and_die("shmat");
+ bb_perror_msg_and_die("shmat");
}
buf->size = data_size;
@@ -171,10 +171,10 @@
if ((s_semid = semget(KEY_ID, 2, IPC_CREAT | IPC_EXCL | 1023)) == -1) {
if (errno == EEXIST) {
if ((s_semid = semget(KEY_ID, 2, 0)) == -1) {
- perror_msg_and_die("semget");
+ bb_perror_msg_and_die("semget");
}
} else {
- perror_msg_and_die("semget");
+ bb_perror_msg_and_die("semget");
}
}
} else {
@@ -471,7 +471,7 @@
remotefd = socket(AF_INET, SOCK_DGRAM, 0);
if (remotefd < 0) {
- error_msg_and_die("cannot create socket");
+ bb_error_msg_and_die("cannot create socket");
}
hostinfo = xgethostbyname(RemoteHost);
@@ -484,7 +484,7 @@
* for future operations
*/
if (0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))) {
- error_msg_and_die("cannot connect to remote host %s:%d", RemoteHost,
+ bb_error_msg_and_die("cannot connect to remote host %s:%d", RemoteHost,
RemotePort);
}
@@ -521,17 +521,17 @@
sunx.sun_family = AF_UNIX;
strncpy(sunx.sun_path, lfile, sizeof(sunx.sun_path));
if ((sock_fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) {
- perror_msg_and_die("Couldn't get file descriptor for socket "
+ bb_perror_msg_and_die("Couldn't get file descriptor for socket "
_PATH_LOG);
}
addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path);
if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) {
- perror_msg_and_die("Could not connect to socket " _PATH_LOG);
+ bb_perror_msg_and_die("Could not connect to socket " _PATH_LOG);
}
if (chmod(lfile, 0666) < 0) {
- perror_msg_and_die("Could not set permission on " _PATH_LOG);
+ bb_perror_msg_and_die("Could not set permission on " _PATH_LOG);
}
#ifdef CONFIG_FEATURE_IPC_SYSLOG
if (circular_logging == TRUE) {
@@ -557,7 +557,7 @@
/* alarm may have happened. */
continue;
}
- perror_msg_and_die("select error");
+ bb_perror_msg_and_die("select error");
}
if (FD_ISSET(sock_fd, &fds)) {
@@ -569,7 +569,7 @@
if ((i = recv(sock_fd, tmpbuf, BUFSIZ, 0)) > 0) {
serveConnection(tmpbuf, i);
} else {
- perror_msg_and_die("UNIX socket error");
+ bb_perror_msg_and_die("UNIX socket error");
}
RELEASE_CONFIG_BUFFER(tmpbuf);
} /* FD_ISSET() */
@@ -598,11 +598,11 @@
break;
#endif
case 'O':
- logFilePath = xstrdup(optarg);
+ logFilePath = bb_xstrdup(optarg);
break;
#ifdef CONFIG_FEATURE_REMOTE_LOG
case 'R':
- RemoteHost = xstrdup(optarg);
+ RemoteHost = bb_xstrdup(optarg);
if ((p = strchr(RemoteHost, ':'))) {
RemotePort = atoi(p + 1);
*p = '\0';
@@ -619,7 +619,7 @@
break;
#endif
default:
- show_usage();
+ bb_show_usage();
}
}
@@ -640,7 +640,7 @@
#if ! defined(__uClinux__)
if ((doFork == TRUE) && (daemon(0, 1) < 0)) {
- perror_msg_and_die("daemon");
+ bb_perror_msg_and_die("daemon");
}
#endif
doSyslogd();