raop_ntp.c: show errno when sendto fails

This commit is contained in:
F. Duncanh
2024-05-10 12:32:11 -04:00
parent 403f72f2c2
commit f3724b4c8c

View File

@@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#ifdef _WIN32
#define CAST (char *)
#else
@@ -296,7 +297,9 @@ raop_ntp_thread(void *arg)
free(str);
}
if (send_len < 0) {
logger_log(raop_ntp->logger, LOGGER_ERR, "raop_ntp error sending request");
int sock_err = SOCKET_GET_ERROR();
logger_log(raop_ntp->logger, LOGGER_ERR, "raop_ntp error sending request. Error %d:%s",
sock_err, strerror(sock_err));
} else {
// Read response
response_len = recvfrom(raop_ntp->tsock, (char *)response, sizeof(response), 0, NULL, NULL);