|
@@ -126,6 +126,7 @@ openlog_intern(void)
|
|
|
{
|
|
|
int fd;
|
|
|
int logType = SOCK_DGRAM;
|
|
|
+ static const struct timeval tv = { 1, 0 };
|
|
|
|
|
|
fd = LogFile;
|
|
|
if (fd == -1) {
|
|
@@ -143,6 +144,9 @@ openlog_intern(void)
|
|
|
|
|
|
if (fd != -1 && !connected) {
|
|
|
if (connect(fd, &SyslogAddr, sizeof(SyslogAddr)) != -1) {
|
|
|
+
|
|
|
+ fcntl(fd, F_SETFL, ~O_NONBLOCK & fcntl(fd, F_GETFL));
|
|
|
+ setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
|
|
connected = 1;
|
|
|
} else {
|
|
|
if (fd != -1) {
|