diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-01-10 19:34:04 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-01-21 11:25:05 +0300 |
commit | 9e4693a1cbac13324bff9a57fa4dace405ee5ab9 (patch) | |
tree | 12cb9498a1541f6f3f5e9750e335b2d0d393e0ce /libavformat/network.c | |
parent | d2519e8625f901856bfc915a1dc1f492bbd8b395 (diff) |
lavf/network: log ff_listen() errors to proper contexts rather than NULL
Diffstat (limited to 'libavformat/network.c')
-rw-r--r-- | libavformat/network.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/network.c b/libavformat/network.c index c3d9f82551..246ffd406d 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -208,12 +208,12 @@ int ff_socket(int af, int type, int proto, void *logctx) } int ff_listen(int fd, const struct sockaddr *addr, - socklen_t addrlen) + socklen_t addrlen, void *logctx) { int ret; int reuse = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))) { - av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_REUSEADDR) failed\n"); + av_log(logctx, AV_LOG_WARNING, "setsockopt(SO_REUSEADDR) failed\n"); } ret = bind(fd, addr, addrlen); if (ret) @@ -247,7 +247,7 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h) { int ret; - if ((ret = ff_listen(fd, addr, addrlen)) < 0) + if ((ret = ff_listen(fd, addr, addrlen, h)) < 0) return ret; if ((ret = ff_accept(fd, timeout, h)) < 0) return ret; |