diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-09-14 23:37:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-09-14 23:37:07 +0000 |
commit | 14bb9457b4eb5d818b044ba7d3dca76c935dcf35 (patch) | |
tree | 7e4e46f42aedd967bfd8f5e51f1ee594869db46e /usr.sbin/syslogd/syslogd.c | |
parent | ec00f6c78f34de4b9ee368f857354035fcb0325b (diff) |
size_t vs ssize_t confusion
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index de3336be80c..7dd0782bb05 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.83 2004/09/14 23:25:34 deraadt Exp $ */ +/* $OpenBSD: syslogd.c,v 1.84 2004/09/14 23:37:06 deraadt Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -39,7 +39,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #else -static const char rcsid[] = "$OpenBSD: syslogd.c,v 1.83 2004/09/14 23:25:34 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: syslogd.c,v 1.84 2004/09/14 23:37:06 deraadt Exp $"; #endif #endif /* not lint */ @@ -546,14 +546,16 @@ main(int argc, char *argv[]) for (i = 0; i < nfunix; i++) { if ((pfd[PFD_UNIX_0 + i].revents & POLLIN) != 0) { + ssize_t rlen; + len = sizeof(fromunix); - len = recvfrom(pfd[PFD_UNIX_0 + i].fd, line, + rlen = recvfrom(pfd[PFD_UNIX_0 + i].fd, line, MAXLINE, 0, (struct sockaddr *)&fromunix, &len); - if (len > 0) { - line[len] = '\0'; + if (rlen > 0) { + line[rlen] = '\0'; printline(LocalHostName, line); - } else if (len < 0 && errno != EINTR) + } else if (rlen == -1 && errno != EINTR) logerror("recvfrom unix"); } } |