Commit 1782fcc0bab7b2ef5a9cdcc685d7d1c1b883e4c8

Authored by Stéphane Raimbault
1 parent 52ab1bbe

Minor - Rename yes variable to enable

Showing 1 changed file with 5 additions and 5 deletions
src/modbus-tcp.c
@@ -473,7 +473,7 @@ static int _modbus_tcp_flush(modbus_t *ctx) @@ -473,7 +473,7 @@ static int _modbus_tcp_flush(modbus_t *ctx)
473 int modbus_tcp_listen(modbus_t *ctx, int nb_connection) 473 int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
474 { 474 {
475 int new_s; 475 int new_s;
476 - int yes; 476 + int enable;
477 struct sockaddr_in addr; 477 struct sockaddr_in addr;
478 modbus_tcp_t *ctx_tcp; 478 modbus_tcp_t *ctx_tcp;
479 479
@@ -495,9 +495,9 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection) @@ -495,9 +495,9 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
495 return -1; 495 return -1;
496 } 496 }
497 497
498 - yes = 1; 498 + enable = 1;
499 if (setsockopt(new_s, SOL_SOCKET, SO_REUSEADDR, 499 if (setsockopt(new_s, SOL_SOCKET, SO_REUSEADDR,
500 - (char *)&yes, sizeof(yes)) == -1) { 500 + (char *)&enable, sizeof(enable)) == -1) {
501 close(new_s); 501 close(new_s);
502 return -1; 502 return -1;
503 } 503 }
@@ -596,9 +596,9 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection) @@ -596,9 +596,9 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
596 } 596 }
597 continue; 597 continue;
598 } else { 598 } else {
599 - int yes = 1; 599 + int enable = 1;
600 rc = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, 600 rc = setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
601 - (void *)&yes, sizeof (yes)); 601 + (void *)&enable, sizeof (enable));
602 if (rc != 0) { 602 if (rc != 0) {
603 close(s); 603 close(s);
604 if (ctx->debug) { 604 if (ctx->debug) {