diff options
-rw-r--r-- | lib/ZOpenPort.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ZOpenPort.c b/lib/ZOpenPort.c index cae00b8..74a6e97 100644 --- a/lib/ZOpenPort.c +++ b/lib/ZOpenPort.c @@ -24,6 +24,9 @@ Code_t ZOpenPort(port) { struct sockaddr_in bindin; int len; +#ifdef SO_BSDCOMPAT + int on = 1; +#endif (void) ZClosePort(); @@ -32,6 +35,11 @@ Code_t ZOpenPort(port) return (errno); } +#ifdef SO_BSDCOMPAT + /* Prevent Linux from giving us socket errors we don't care about. */ + setsockopt(__Zephyr_fd, SOL_SOCKET, SO_BSDCOMPAT, &on, sizeof(on)); +#endif + bindin.sin_family = AF_INET; if (port && *port) |