Skip to content

Commit faead6a

Browse files
committed
Fix some logging prints to new logging
1 parent 3b0576d commit faead6a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/modbus-tcp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
644644
s = socket(ai_ptr->ai_family, flags, ai_ptr->ai_protocol);
645645
if (s < 0) {
646646
if (ctx->debug) {
647-
perror("socket");
647+
modbus_trace_error(ctx, "socket: %s\n", strerror(errno));
648648
}
649649
continue;
650650
} else {
@@ -654,7 +654,7 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
654654
if (rc != 0) {
655655
close(s);
656656
if (ctx->debug) {
657-
perror("setsockopt");
657+
modbus_trace_error(ctx, "setsockopt: %s\n", strerror(errno));
658658
}
659659
continue;
660660
}
@@ -664,7 +664,7 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
664664
if (rc != 0) {
665665
close(s);
666666
if (ctx->debug) {
667-
perror("bind");
667+
modbus_trace_error(ctx, "bind: %s\n", strerror(errno));
668668
}
669669
continue;
670670
}
@@ -673,7 +673,7 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
673673
if (rc != 0) {
674674
close(s);
675675
if (ctx->debug) {
676-
perror("listen");
676+
modbus_trace_error(ctx, "listen: %s\n", strerror(errno));
677677
}
678678
continue;
679679
}

0 commit comments

Comments
 (0)