MINOR: sockpair: move send_fd_uxst() error message in caller
Move the ha_alert() in send_fd_uxst() in the callers and add the FD
numbers in the message.
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 60880b2..1c5d742 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -245,7 +245,6 @@
memcpy(fdptr, &send_fd, sizeof(send_fd));
if (sendmsg(fd, &msghdr, 0) != sizeof(iobuf)) {
- ha_warning("Failed to transfer socket\n");
return -1;
}
@@ -341,6 +340,7 @@
/* The new socket is sent on the other side, it should be retrieved and
* considered as an 'accept' socket on the server side */
if (send_fd_uxst(dst_fd, sv[0]) == -1) {
+ ha_alert("socketpair: Cannot transfer the fd %d over sockpair@%d. Giving up.\n", sv[0], dst_fd);
close(sv[0]);
close(sv[1]);
conn->err_code = CO_ER_SOCK_ERR;
diff --git a/src/sock.c b/src/sock.c
index a74e819..1482c1a 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -322,7 +322,7 @@
}
if (send_fd_uxst(dst_fd, sv[0]) == -1) {
- ha_alert("socketpair: cannot transfer socket.\n");
+ ha_alert("socketpair: Cannot transfer the fd %d over sockpair@%d. Giving up.\n", sv[0], dst_fd);
close(sv[0]);
close(sv[1]);
goto out;