This depmod script will create a modules.dep file, just like the depmod
[oweals/busybox.git] / syslogd.c
index 6be51d7dc66642f12cc1d2c974b8f68be53db409..14219eb541f2b8710d91951abc3362966841f4cc 100644 (file)
--- a/syslogd.c
+++ b/syslogd.c
@@ -55,7 +55,7 @@
 #define __LOG_FILE "/var/log/messages"
 
 /* Path to the unix socket */
-static char lfile[BUFSIZ] = "";
+static char lfile[BUFSIZ];
 
 static char *logFilePath = __LOG_FILE;
 
@@ -155,8 +155,6 @@ void ipcsyslog_init(void){
                    perror_msg_and_die("semget");
                }else
                        perror_msg_and_die("semget");
-           } else {
-                   sem_up(s_semid);
            }
        }else{
                printf("Buffer already allocated just grab the semaphore?");
@@ -348,7 +346,7 @@ static const int IOV_COUNT = 2;
                struct iovec iov[IOV_COUNT];
                struct iovec *v = iov;
 
-               bzero(&res, sizeof(res));
+               memset(&res, 0, sizeof(res));
                snprintf(res, sizeof(res), "<%d>", pri);
                v->iov_base = res ;
                v->iov_len = strlen(res);          
@@ -389,7 +387,9 @@ static void domark(int sig)
        }
 }
 
-static const int BUFSIZE = 1023;
+/* This must be a #define, since when DODEBUG and BUFFERS_GO_IN_BSS are
+ * enabled, we otherwise get a "storage size isn't constant error. */
+#define BUFSIZE 1023
 static int serveConnection (int conn)
 {
        RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1);
@@ -431,6 +431,7 @@ static int serveConnection (int conn)
                /* Now log it */
                logMessage (pri, line);
        }
+       RELEASE_BB_BUFFER (tmpbuf);
        return n_read;
 }
 
@@ -442,7 +443,7 @@ static void init_RemoteLog (void){
   struct hostent *hostinfo;
   int len = sizeof(remoteaddr);
 
-  bzero(&remoteaddr, len);
+  memset(&remoteaddr, 0, len);
 
   remotefd = socket(AF_INET, SOCK_DGRAM, 0);