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