Explorar o código

Fix semicolon typo and unistd.h include under windows

Andrew Kravchuk %!s(int64=13) %!d(string=hai) anos
pai
achega
6350a99224
Modificáronse 2 ficheiros con 4 adicións e 2 borrados
  1. 2 2
      src/modbus-rtu.c
  2. 2 0
      src/modbus.c

+ 2 - 2
src/modbus-rtu.c

@@ -447,7 +447,7 @@ static int _modbus_rtu_connect(modbus_t *ctx)
     if (!GetCommState(ctx_rtu->w_ser.fd, &ctx_rtu->old_dcb)) {
         fprintf(stderr, "ERROR Error getting configuration (LastError %d)\n",
                 (int)GetLastError());
-        CloseHandle(ctx_rtu->w_ser.fd)
+        CloseHandle(ctx_rtu->w_ser.fd);
         ctx_rtu->w_ser.fd = INVALID_HANDLE_VALUE;
         return -1;
     }
@@ -551,7 +551,7 @@ static int _modbus_rtu_connect(modbus_t *ctx)
     if (!SetCommState(ctx_rtu->w_ser.fd, &dcb)) {
         fprintf(stderr, "ERROR Error setting new configuration (LastError %d)\n",
                 (int)GetLastError());
-        CloseHandle(ctx_rtu->w_ser.fd)
+        CloseHandle(ctx_rtu->w_ser.fd);
         ctx_rtu->w_ser.fd = INVALID_HANDLE_VALUE;
         return -1;
     }

+ 2 - 0
src/modbus.c

@@ -26,7 +26,9 @@
 #include <errno.h>
 #include <limits.h>
 #include <time.h>
+#ifndef _MSC_VER
 #include <unistd.h>
+#endif
 
 #include <config.h>