Kaynağa Gözat

Rename type as flags for consistency between functions

Stéphane Raimbault 6 yıl önce
ebeveyn
işleme
6c14b7fc22
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      src/modbus-tcp.c

+ 4 - 4
src/modbus-tcp.c

@@ -481,7 +481,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
 {
 {
     int new_s;
     int new_s;
     int enable;
     int enable;
-    int type;
+    int flags;
     struct sockaddr_in addr;
     struct sockaddr_in addr;
     modbus_tcp_t *ctx_tcp;
     modbus_tcp_t *ctx_tcp;
 
 
@@ -498,13 +498,13 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
     }
     }
 #endif
 #endif
 
 
-    type = SOCK_STREAM;
+    flags = SOCK_STREAM;
 
 
 #ifdef SOCK_CLOEXEC
 #ifdef SOCK_CLOEXEC
-    type |= SOCK_CLOEXEC;
+    flags |= SOCK_CLOEXEC;
 #endif
 #endif
 
 
-    new_s = socket(PF_INET, type, IPPROTO_TCP);
+    new_s = socket(PF_INET, flags, IPPROTO_TCP);
     if (new_s == -1) {
     if (new_s == -1) {
         return -1;
         return -1;
     }
     }