aboutsummaryrefslogtreecommitdiff
path: root/minilogd.c
diff options
context:
space:
mode:
authorJonathan Frazier <eyeswide@gmail.com>2008-01-08 03:26:12 -0600
committerAaron Griffin <aaronmgriffin@gmail.com>2008-01-08 09:30:58 -0600
commitcd0b3911131ee0eddc32c5e3992036c2e769948f (patch)
tree4962efae617ee350d0edb0e4e76ad43f49d223a2 /minilogd.c
parent9bf2014b750579d9720c13c9dfb9d358e0c27665 (diff)
downloadinitscripts-cd0b3911131ee0eddc32c5e3992036c2e769948f.tar.xz
minilogd cleanup and warning fixes
gcc gives a warning about signed/unsigned ints, and it tries to write to syslog's /dev/log with a dgram socket which gives an EPROTOCOL error. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'minilogd.c')
-rw-r--r--minilogd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/minilogd.c b/minilogd.c
index 9e38094..b24fb75 100644
--- a/minilogd.c
+++ b/minilogd.c
@@ -1,4 +1,3 @@
-
/* minilogd.c
*
* A pale imitation of syslogd. Most notably, doesn't write anything
@@ -43,7 +42,7 @@ void freeBuffer() {
strncpy(addr.sun_path,_PATH_LOG,sizeof(addr.sun_path)-1);
/* wait for klogd to hit syslog */
sleep(2);
- sock = socket(AF_LOCAL, SOCK_DGRAM,0);
+ sock = socket(AF_LOCAL, SOCK_STREAM,0);
conn=connect(sock,(struct sockaddr *) &addr,sizeof(addr));
while (x<buflines) {
if (!conn) {
@@ -72,7 +71,8 @@ void cleanup(int exitcode) {
void runDaemon(int sock) {
struct sockaddr_un addr;
- int x,len,addrlen,done=0;
+ int x,len,done=0;
+ socklen_t addrlen;
char *message;
struct stat s1,s2;
struct pollfd pfds;