Commit 6350a9922456c8604107551f8b93e1eae0a3e0fd

Authored by Andrew Kravchuk
1 parent 7e170c34

Fix semicolon typo and unistd.h include under windows

src/modbus-rtu.c
... ... @@ -447,7 +447,7 @@ static int _modbus_rtu_connect(modbus_t *ctx)
447 447 if (!GetCommState(ctx_rtu->w_ser.fd, &ctx_rtu->old_dcb)) {
448 448 fprintf(stderr, "ERROR Error getting configuration (LastError %d)\n",
449 449 (int)GetLastError());
450   - CloseHandle(ctx_rtu->w_ser.fd)
  450 + CloseHandle(ctx_rtu->w_ser.fd);
451 451 ctx_rtu->w_ser.fd = INVALID_HANDLE_VALUE;
452 452 return -1;
453 453 }
... ... @@ -551,7 +551,7 @@ static int _modbus_rtu_connect(modbus_t *ctx)
551 551 if (!SetCommState(ctx_rtu->w_ser.fd, &dcb)) {
552 552 fprintf(stderr, "ERROR Error setting new configuration (LastError %d)\n",
553 553 (int)GetLastError());
554   - CloseHandle(ctx_rtu->w_ser.fd)
  554 + CloseHandle(ctx_rtu->w_ser.fd);
555 555 ctx_rtu->w_ser.fd = INVALID_HANDLE_VALUE;
556 556 return -1;
557 557 }
... ...
src/modbus.c
... ... @@ -26,7 +26,9 @@
26 26 #include <errno.h>
27 27 #include <limits.h>
28 28 #include <time.h>
  29 +#ifndef _MSC_VER
29 30 #include <unistd.h>
  31 +#endif
30 32  
31 33 #include <config.h>
32 34  
... ...