Przeglądaj źródła

Minor - Rename yes variable to enable

Stéphane Raimbault 9 lat temu
rodzic
commit
1782fcc0ba
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      src/modbus-tcp.c

+ 5 - 5
src/modbus-tcp.c

@@ -473,7 +473,7 @@ static int _modbus_tcp_flush(modbus_t *ctx)
 int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
 {
     int new_s;
-    int yes;
+    int enable;
     struct sockaddr_in addr;
     modbus_tcp_t *ctx_tcp;
 
@@ -495,9 +495,9 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
         return -1;
     }
 
-    yes = 1;
+    enable = 1;
     if (setsockopt(new_s, SOL_SOCKET, SO_REUSEADDR,
-                   (char *)&yes, sizeof(yes)) == -1) {
+                   (char *)&enable, sizeof(enable)) == -1) {
         close(new_s);
         return -1;
     }
@@ -596,9 +596,9 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
             }
             continue;
         } else {
-            int yes = 1;
+            int enable = 1;
             rc = setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
-                            (void *)&yes, sizeof (yes));
+                            (void *)&enable, sizeof (enable));
             if (rc != 0) {
                 close(s);
                 if (ctx->debug) {