summaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
author"Vladimir N. Oleynik"2005-10-15 13:49:21 +0000
committer"Vladimir N. Oleynik"2005-10-15 13:49:21 +0000
commitb32b1db9d8dda5ca774b338270042e1ee89bfa3e (patch)
tree76a91c8bd1c37a24294a08cc6628f6eda95ed11b /sysklogd
parenta2eec6051f81b272521da3001f52d1e43abde6df (diff)
downloadbusybox-b32b1db9d8dda5ca774b338270042e1ee89bfa3e.zip
busybox-b32b1db9d8dda5ca774b338270042e1ee89bfa3e.tar.gz
complex RESERVE_CONFIG_BUFFER --> bb_common_bufsiz1
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/syslogd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 3a8e519..e754806 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -600,16 +600,19 @@ static void doSyslogd(void)
if (FD_ISSET(sock_fd, &fds)) {
int i;
+#if MAXLINE > BUFSIZ
+# define TMP_BUF_SZ BUFSIZ
+#else
+# define TMP_BUF_SZ MAXLINE
+#endif
+#define tmpbuf bb_common_bufsiz1
- RESERVE_CONFIG_BUFFER(tmpbuf, MAXLINE + 1);
-
- memset(tmpbuf, '\0', MAXLINE + 1);
- if ((i = recv(sock_fd, tmpbuf, MAXLINE, 0)) > 0) {
+ if ((i = recv(sock_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
+ tmpbuf[i] = '\0';
serveConnection(tmpbuf, i);
} else {
bb_perror_msg_and_die("UNIX socket error");
}
- RELEASE_CONFIG_BUFFER(tmpbuf);
} /* FD_ISSET() */
} /* for main loop */
}