module-rtp: save errno before doing pw_log_error

We can't assume the errno value won't be clobbered.
This commit is contained in:
Wim Taymans 2024-03-25 13:21:42 +01:00
parent 4ffd74ef46
commit ac6011dfa5

View file

@ -206,8 +206,9 @@ static int make_socket(const struct sockaddr* sa, socklen_t salen, char *ifname)
af = sa->sa_family; af = sa->sa_family;
if ((fd = socket(af, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0)) < 0) { if ((fd = socket(af, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0)) < 0) {
res = -errno;
pw_log_error("socket failed: %m"); pw_log_error("socket failed: %m");
return -errno; return res;
} }
#ifdef SO_TIMESTAMP #ifdef SO_TIMESTAMP
val = 1; val = 1;