Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/syslogd Make it compilable with gcc
details: https://anonhg.NetBSD.org/src/rev/afa9aeae0eda
branches: trunk
changeset: 836769:afa9aeae0eda
user: martin <martin%NetBSD.org@localhost>
date: Mon Nov 05 08:34:20 2018 +0000
description:
Make it compilable with gcc
diffstat:
usr.sbin/syslogd/syslogd.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diffs (58 lines):
diff -r cc92c6bf8e71 -r afa9aeae0eda usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c Mon Nov 05 07:42:56 2018 +0000
+++ b/usr.sbin/syslogd/syslogd.c Mon Nov 05 08:34:20 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syslogd.c,v 1.127 2018/11/04 20:45:21 roy Exp $ */
+/* $NetBSD: syslogd.c,v 1.128 2018/11/05 08:34:20 martin Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
-__RCSID("$NetBSD: syslogd.c,v 1.127 2018/11/04 20:45:21 roy Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.128 2018/11/05 08:34:20 martin Exp $");
#endif
#endif /* not lint */
@@ -75,6 +75,9 @@
#include "syslogd.h"
#include "extern.h"
+/* Minimum size of the logpath socket buffer */
+#define RCVBUFLEN 16384
+
#ifndef DISABLE_SIGN
#include "sign.h"
struct sign_global_t GlobalSign = {
@@ -493,6 +496,9 @@
die(0, 0, NULL);
}
for (j = 0, pp = LogPaths; *pp; pp++, j++) {
+ int buf_len;
+ socklen_t socklen = sizeof(buf_len);
+
DPRINTF(D_NET, "Making unix dgram socket `%s'\n", *pp);
unlink(*pp);
memset(&sunx, 0, sizeof(sunx));
@@ -507,6 +513,19 @@
}
setsockbuf(funix[j], *pp);
DPRINTF(D_NET, "Listening on unix dgram socket `%s'\n", *pp);
+ if (getsockopt(funix[j], SOL_SOCKET, SO_RCVBUF,
+ &buf_len, &socklen) == -1) {
+ logerror("getsockopt: SO_RCVBUF: `%s'", *pp);
+ continue;
+ }
+ if (buf_len >= RCVBUFLEN)
+ continue;
+ buf_len = RCVBUFLEN;
+ if (setsockopt(funix[j], SOL_SOCKET, SO_RCVBUF,
+ &buf_len, socklen) == -1) {
+ logerror("setsockopt: SO_RCVBUF: `%s'", *pp);
+ continue;
+ }
}
if ((fklog = open(_PATH_KLOG, O_RDONLY, 0)) < 0) {
Home |
Main Index |
Thread Index |
Old Index