Thought of another janitorial item for the list.
[oweals/busybox.git] / syslogd.c
index 972fda15f245c03946c2c88c208648f60f337e51..8049fc5d1675777c5b599b1631808f03f21e491e 100644 (file)
--- a/syslogd.c
+++ b/syslogd.c
@@ -2,7 +2,7 @@
 /*
  * Mini syslogd implementation for busybox
  *
- * Copyright (C) 1999,2000 by Lineo, inc.
+ * Copyright (C) 1999,2000,2001 by Lineo, inc.
  * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
  *
  * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org>
@@ -23,7 +23,6 @@
  *
  */
 
-#include "busybox.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
@@ -34,6 +33,7 @@
 #include <signal.h>
 #include <stdarg.h>
 #include <time.h>
+#include <string.h>
 #include <unistd.h>
 #include <sys/socket.h>
 #include <sys/types.h>
@@ -41,7 +41,8 @@
 #include <sys/param.h>
 
 #if ! defined __GLIBC__ && ! defined __UCLIBC__
-
+#include <sys/syscall.h>
+#include <linux/unistd.h>
 typedef unsigned int socklen_t;
 
 #ifndef __alpha__
@@ -54,6 +55,7 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
 #else
 # include <sys/klog.h>
 #endif
+#include "busybox.h"
 
 
 
@@ -180,7 +182,7 @@ static const int IOV_COUNT = 2;
 
                if ( -1 == writev(remotefd,iov, IOV_COUNT)){
                        error_msg_and_die("syslogd: cannot write to remote file handle on" 
-                                       "%s:%d\n",RemoteHost,RemotePort);
+                                       "%s:%d",RemoteHost,RemotePort);
                }
        }
        if (local_logging == TRUE)
@@ -262,13 +264,13 @@ static void init_RemoteLog (void){
   remotefd = socket(AF_INET, SOCK_DGRAM, 0);
 
   if (remotefd < 0) {
-    error_msg_and_die("syslogd: cannot create socket\n");
+    error_msg_and_die("syslogd: cannot create socket");
   }
 
   hostinfo = (struct hostent *) gethostbyname(RemoteHost);
 
   if (!hostinfo) {
-    error_msg_and_die("syslogd: cannot resolve remote host name [%s]\n", RemoteHost);
+    error_msg_and_die("syslogd: cannot resolve remote host name [%s]", RemoteHost);
   }
 
   remoteaddr.sin_family = AF_INET;
@@ -280,7 +282,7 @@ static void init_RemoteLog (void){
      for future operations
   */
   if ( 0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))){
-    error_msg_and_die("syslogd: cannot connect to remote host %s:%d\n", RemoteHost, RemotePort);
+    error_msg_and_die("syslogd: cannot connect to remote host %s:%d", RemoteHost, RemotePort);
   }
 
 }
@@ -517,7 +519,7 @@ extern int syslogd_main(int argc, char **argv)
                                break;
 #endif
                        default:
-                               usage(syslogd_usage);
+                               show_usage();
                }
        }