diff mbox series

[FFmpeg-devel,v3,1/3] avformat/network: add ff_neterrno2() for cases where we already have an errno

Message ID 20240419190801.169291-1-ffmpeg-devel@pileofstuff.org
State New
Headers show
Series [FFmpeg-devel,v3,1/3] avformat/network: add ff_neterrno2() for cases where we already have an errno | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andrew Sayers April 19, 2024, 7:07 p.m. UTC
For example, WSAStartup()'s documentation says:

    "A call to the WSAGetLastError function is not needed and should not be used"
---
 libavformat/network.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Stefano Sabatini April 20, 2024, 7:57 a.m. UTC | #1
On date Friday 2024-04-19 20:07:59 +0100, Andrew Sayers wrote:
> For example, WSAStartup()'s documentation says:
> 
>     "A call to the WSAGetLastError function is not needed and should not be used"
> ---
>  libavformat/network.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

missing declaration in network.h?
diff mbox series

Patch

diff --git a/libavformat/network.c b/libavformat/network.c
index f752efc411..fb70f9cafc 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -121,9 +121,14 @@  void ff_network_close(void)
 }
 
 #if HAVE_WINSOCK2_H
+
+}
 int ff_neterrno(void)
 {
-    int err = WSAGetLastError();
+    return ff_neterrno2(WSAGetLastError());
+}
+int ff_neterrno2(int err)
+{
     switch (err) {
     case WSAEWOULDBLOCK:
         return AVERROR(EAGAIN);