aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/klogd.c10
-rw-r--r--sysklogd/logger.c6
-rw-r--r--sysklogd/logread.c2
-rw-r--r--sysklogd/syslogd.c34
4 files changed, 26 insertions, 26 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 4132eb68e..b76a52ff7 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -136,12 +136,12 @@ extern int klogd_main(int argc, char **argv)
136 switch (opt) { 136 switch (opt) {
137 case 'c': 137 case 'c':
138 if ((optarg == NULL) || (optarg[1] != '\0')) { 138 if ((optarg == NULL) || (optarg[1] != '\0')) {
139 show_usage(); 139 bb_show_usage();
140 } 140 }
141 /* Valid levels are between 1 and 8 */ 141 /* Valid levels are between 1 and 8 */
142 console_log_level = *optarg - '1'; 142 console_log_level = *optarg - '1';
143 if (console_log_level > 7) { 143 if (console_log_level > 7) {
144 show_usage(); 144 bb_show_usage();
145 } 145 }
146 console_log_level++; 146 console_log_level++;
147 147
@@ -150,16 +150,16 @@ extern int klogd_main(int argc, char **argv)
150 doFork = FALSE; 150 doFork = FALSE;
151 break; 151 break;
152 default: 152 default:
153 show_usage(); 153 bb_show_usage();
154 } 154 }
155 } 155 }
156 156
157 if (doFork) { 157 if (doFork) {
158#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) 158#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
159 if (daemon(0, 1) < 0) 159 if (daemon(0, 1) < 0)
160 perror_msg_and_die("daemon"); 160 bb_perror_msg_and_die("daemon");
161#else 161#else
162 error_msg_and_die("daemon not supported"); 162 bb_error_msg_and_die("daemon not supported");
163#endif 163#endif
164 } 164 }
165 doKlogd(console_log_level); 165 doKlogd(console_log_level);
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index bb63975e7..1b55bf589 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -89,14 +89,14 @@ static int pencode(char *s)
89 *s = '\0'; 89 *s = '\0';
90 fac = decode(save, facilitynames); 90 fac = decode(save, facilitynames);
91 if (fac < 0) 91 if (fac < 0)
92 error_msg_and_die("unknown facility name: %s", save); 92 bb_error_msg_and_die("unknown facility name: %s", save);
93 *s++ = '.'; 93 *s++ = '.';
94 } else { 94 } else {
95 s = save; 95 s = save;
96 } 96 }
97 lev = decode(s, prioritynames); 97 lev = decode(s, prioritynames);
98 if (lev < 0) 98 if (lev < 0)
99 error_msg_and_die("unknown priority name: %s", save); 99 bb_error_msg_and_die("unknown priority name: %s", save);
100 return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK)); 100 return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
101} 101}
102 102
@@ -124,7 +124,7 @@ extern int logger_main(int argc, char **argv)
124 safe_strncpy(name, optarg, sizeof(name)); 124 safe_strncpy(name, optarg, sizeof(name));
125 break; 125 break;
126 default: 126 default:
127 show_usage(); 127 bb_show_usage();
128 } 128 }
129 } 129 }
130 130
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index ecdf2f579..ae8dbae3a 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -87,7 +87,7 @@ extern int logread_main(int argc, char **argv)
87 87
88 /* no options, no getopt */ 88 /* no options, no getopt */
89 if (argc > 1) 89 if (argc > 1)
90 show_usage(); 90 bb_show_usage();
91 91
92 // handle intrrupt signal 92 // handle intrrupt signal
93 if (setjmp(jmp_env)) goto output_end; 93 if (setjmp(jmp_env)) goto output_end;
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 1c58a64f8..b912f5f8f 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -123,7 +123,7 @@ static int circular_logging = FALSE;
123static inline void sem_up(int semid) 123static inline void sem_up(int semid)
124{ 124{
125 if (semop(semid, SMwup, 1) == -1) { 125 if (semop(semid, SMwup, 1) == -1) {
126 perror_msg_and_die("semop[SMwup]"); 126 bb_perror_msg_and_die("semop[SMwup]");
127 } 127 }
128} 128}
129 129
@@ -133,7 +133,7 @@ static inline void sem_up(int semid)
133static inline void sem_down(int semid) 133static inline void sem_down(int semid)
134{ 134{
135 if (semop(semid, SMwdn, 3) == -1) { 135 if (semop(semid, SMwdn, 3) == -1) {
136 perror_msg_and_die("semop[SMwdn]"); 136 bb_perror_msg_and_die("semop[SMwdn]");
137 } 137 }
138} 138}
139 139
@@ -157,11 +157,11 @@ void ipcsyslog_init(void)
157{ 157{
158 if (buf == NULL) { 158 if (buf == NULL) {
159 if ((shmid = shmget(KEY_ID, shm_size, IPC_CREAT | 1023)) == -1) { 159 if ((shmid = shmget(KEY_ID, shm_size, IPC_CREAT | 1023)) == -1) {
160 perror_msg_and_die("shmget"); 160 bb_perror_msg_and_die("shmget");
161 } 161 }
162 162
163 if ((buf = shmat(shmid, NULL, 0)) == NULL) { 163 if ((buf = shmat(shmid, NULL, 0)) == NULL) {
164 perror_msg_and_die("shmat"); 164 bb_perror_msg_and_die("shmat");
165 } 165 }
166 166
167 buf->size = data_size; 167 buf->size = data_size;
@@ -171,10 +171,10 @@ void ipcsyslog_init(void)
171 if ((s_semid = semget(KEY_ID, 2, IPC_CREAT | IPC_EXCL | 1023)) == -1) { 171 if ((s_semid = semget(KEY_ID, 2, IPC_CREAT | IPC_EXCL | 1023)) == -1) {
172 if (errno == EEXIST) { 172 if (errno == EEXIST) {
173 if ((s_semid = semget(KEY_ID, 2, 0)) == -1) { 173 if ((s_semid = semget(KEY_ID, 2, 0)) == -1) {
174 perror_msg_and_die("semget"); 174 bb_perror_msg_and_die("semget");
175 } 175 }
176 } else { 176 } else {
177 perror_msg_and_die("semget"); 177 bb_perror_msg_and_die("semget");
178 } 178 }
179 } 179 }
180 } else { 180 } else {
@@ -471,7 +471,7 @@ static void init_RemoteLog(void)
471 remotefd = socket(AF_INET, SOCK_DGRAM, 0); 471 remotefd = socket(AF_INET, SOCK_DGRAM, 0);
472 472
473 if (remotefd < 0) { 473 if (remotefd < 0) {
474 error_msg_and_die("cannot create socket"); 474 bb_error_msg_and_die("cannot create socket");
475 } 475 }
476 476
477 hostinfo = xgethostbyname(RemoteHost); 477 hostinfo = xgethostbyname(RemoteHost);
@@ -484,7 +484,7 @@ static void init_RemoteLog(void)
484 * for future operations 484 * for future operations
485 */ 485 */
486 if (0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))) { 486 if (0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))) {
487 error_msg_and_die("cannot connect to remote host %s:%d", RemoteHost, 487 bb_error_msg_and_die("cannot connect to remote host %s:%d", RemoteHost,
488 RemotePort); 488 RemotePort);
489 } 489 }
490 490
@@ -521,17 +521,17 @@ static void doSyslogd(void)
521 sunx.sun_family = AF_UNIX; 521 sunx.sun_family = AF_UNIX;
522 strncpy(sunx.sun_path, lfile, sizeof(sunx.sun_path)); 522 strncpy(sunx.sun_path, lfile, sizeof(sunx.sun_path));
523 if ((sock_fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) { 523 if ((sock_fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) {
524 perror_msg_and_die("Couldn't get file descriptor for socket " 524 bb_perror_msg_and_die("Couldn't get file descriptor for socket "
525 _PATH_LOG); 525 _PATH_LOG);
526 } 526 }
527 527
528 addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path); 528 addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path);
529 if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) { 529 if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) {
530 perror_msg_and_die("Could not connect to socket " _PATH_LOG); 530 bb_perror_msg_and_die("Could not connect to socket " _PATH_LOG);
531 } 531 }
532 532
533 if (chmod(lfile, 0666) < 0) { 533 if (chmod(lfile, 0666) < 0) {
534 perror_msg_and_die("Could not set permission on " _PATH_LOG); 534 bb_perror_msg_and_die("Could not set permission on " _PATH_LOG);
535 } 535 }
536#ifdef CONFIG_FEATURE_IPC_SYSLOG 536#ifdef CONFIG_FEATURE_IPC_SYSLOG
537 if (circular_logging == TRUE) { 537 if (circular_logging == TRUE) {
@@ -557,7 +557,7 @@ static void doSyslogd(void)
557 /* alarm may have happened. */ 557 /* alarm may have happened. */
558 continue; 558 continue;
559 } 559 }
560 perror_msg_and_die("select error"); 560 bb_perror_msg_and_die("select error");
561 } 561 }
562 562
563 if (FD_ISSET(sock_fd, &fds)) { 563 if (FD_ISSET(sock_fd, &fds)) {
@@ -569,7 +569,7 @@ static void doSyslogd(void)
569 if ((i = recv(sock_fd, tmpbuf, BUFSIZ, 0)) > 0) { 569 if ((i = recv(sock_fd, tmpbuf, BUFSIZ, 0)) > 0) {
570 serveConnection(tmpbuf, i); 570 serveConnection(tmpbuf, i);
571 } else { 571 } else {
572 perror_msg_and_die("UNIX socket error"); 572 bb_perror_msg_and_die("UNIX socket error");
573 } 573 }
574 RELEASE_CONFIG_BUFFER(tmpbuf); 574 RELEASE_CONFIG_BUFFER(tmpbuf);
575 } /* FD_ISSET() */ 575 } /* FD_ISSET() */
@@ -598,11 +598,11 @@ extern int syslogd_main(int argc, char **argv)
598 break; 598 break;
599#endif 599#endif
600 case 'O': 600 case 'O':
601 logFilePath = xstrdup(optarg); 601 logFilePath = bb_xstrdup(optarg);
602 break; 602 break;
603#ifdef CONFIG_FEATURE_REMOTE_LOG 603#ifdef CONFIG_FEATURE_REMOTE_LOG
604 case 'R': 604 case 'R':
605 RemoteHost = xstrdup(optarg); 605 RemoteHost = bb_xstrdup(optarg);
606 if ((p = strchr(RemoteHost, ':'))) { 606 if ((p = strchr(RemoteHost, ':'))) {
607 RemotePort = atoi(p + 1); 607 RemotePort = atoi(p + 1);
608 *p = '\0'; 608 *p = '\0';
@@ -619,7 +619,7 @@ extern int syslogd_main(int argc, char **argv)
619 break; 619 break;
620#endif 620#endif
621 default: 621 default:
622 show_usage(); 622 bb_show_usage();
623 } 623 }
624 } 624 }
625 625
@@ -640,7 +640,7 @@ extern int syslogd_main(int argc, char **argv)
640 640
641#if ! defined(__uClinux__) 641#if ! defined(__uClinux__)
642 if ((doFork == TRUE) && (daemon(0, 1) < 0)) { 642 if ((doFork == TRUE) && (daemon(0, 1) < 0)) {
643 perror_msg_and_die("daemon"); 643 bb_perror_msg_and_die("daemon");
644 } 644 }
645#endif 645#endif
646 doSyslogd(); 646 doSyslogd();