Skip to content

Commit 14babda

Browse files
author
Alexander Perepelkin
committed
fix for bugs-143
1 parent c7d21d8 commit 14babda

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/RemoteSyslogAppender.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,14 @@ namespace log4cpp {
114114
_ipAddr = *(in_addr_t*)(pent->h_addr); // fixed bug #1579890
115115
}
116116
// Get a datagram socket.
117-
118-
if ((_socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
117+
_socket = socket(AF_INET, SOCK_DGRAM, 0);
118+
if
119+
#ifdef WIN32
120+
(_socket == INVALID_SOCKET)
121+
#else
122+
(_socket < 0)
123+
#endif
124+
{
119125
// loglog("RemoteSyslogAppender: failed to open socket");
120126
return; // fail silently
121127
}

0 commit comments

Comments
 (0)