This patch also changes FF_NETERROR() to be an AVERROR(), i.e. it is always
negative, whereas it was previously positive.
Originally committed as revision 22887 to svn://svn.ffmpeg.org/ffmpeg/trunk
#include <winsock2.h>
#include <ws2tcpip.h>
-#define ff_neterrno() WSAGetLastError()
-#define FF_NETERROR(err) WSA##err
+#define ff_neterrno() (-WSAGetLastError())
+#define FF_NETERROR(err) (-WSA##err)
#define WSAEAGAIN WSAEWOULDBLOCK
#else
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
-#define ff_neterrno() errno
-#define FF_NETERROR(err) err
+#define ff_neterrno() AVERROR(errno)
+#define FF_NETERROR(err) AVERROR(err)
#endif
#if HAVE_ARPA_INET_H
}
#endif
} else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
- return AVERROR(ETIMEDOUT);
+ return FF_NETERROR(ETIMEDOUT);
} else if (n < 0 && errno != EINTR)
return AVERROR(errno);
}