Commit fd892617f0143b72ada33cfc37a801d198b2e339
1 parent
626e3b6c
Fix closing of Win32 socket
Win32 uses a specific function to close socket. Reported by Petr Parýzek.
Showing
2 changed files
with
3 additions
and
0 deletions
NEWS
| 1 | libmodbus 2.9.3 (2011-01-XX) | 1 | libmodbus 2.9.3 (2011-01-XX) |
| 2 | ============================ | 2 | ============================ |
| 3 | 3 | ||
| 4 | +- Fix closing of Win32 socket. | ||
| 5 | + Reported by Petr Parýzek. | ||
| 4 | - Fix unit identifier not copied by the TCP server. | 6 | - Fix unit identifier not copied by the TCP server. |
| 5 | Reported by Antti Manninen. | 7 | Reported by Antti Manninen. |
| 6 | - New function to reply to an indication with an exception message | 8 | - New function to reply to an indication with an exception message |
src/modbus-tcp.c
| @@ -27,6 +27,7 @@ | @@ -27,6 +27,7 @@ | ||
| 27 | # include <winsock2.h> | 27 | # include <winsock2.h> |
| 28 | # include <ws2tcpip.h> | 28 | # include <ws2tcpip.h> |
| 29 | # define SHUT_RDWR 2 | 29 | # define SHUT_RDWR 2 |
| 30 | +# define close closesocket | ||
| 30 | #else | 31 | #else |
| 31 | # include <sys/socket.h> | 32 | # include <sys/socket.h> |
| 32 | # include <sys/ioctl.h> | 33 | # include <sys/ioctl.h> |