Jelajahi Sumber

Fix closing of Win32 socket

Win32 uses a specific function to close socket.
Reported by Petr Parýzek.
Stéphane Raimbault 14 tahun lalu
induk
melakukan
fd892617f0
2 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 2 0
      NEWS
  2. 1 0
      src/modbus-tcp.c

+ 2 - 0
NEWS

@@ -1,6 +1,8 @@
 libmodbus 2.9.3 (2011-01-XX)
 ============================
 
+- Fix closing of Win32 socket.
+  Reported by Petr Parýzek.
 - Fix unit identifier not copied by the TCP server.
   Reported by Antti Manninen.
 - New function to reply to an indication with an exception message

+ 1 - 0
src/modbus-tcp.c

@@ -27,6 +27,7 @@
 # include <winsock2.h>
 # include <ws2tcpip.h>
 # define SHUT_RDWR 2
+# define close closesocket
 #else
 # include <sys/socket.h>
 # include <sys/ioctl.h>