wget/wget-errno-clobber.patch
Reinhard Max 93aa9f5113 Accepting request 415615 from home:jmoellers:branches:network:utilities
- Save/restore errno within CLOSE_FINISH and CLOSE_INVALIDATE.
  (wget-errno-clobber.patch, boo#983660)

OBS-URL: https://build.opensuse.org/request/show/415615
OBS-URL: https://build.opensuse.org/package/show/network:utilities/wget?expand=0&rev=62
2016-07-29 08:22:59 +00:00

31 lines
1.2 KiB
Diff

Index: wget-1.18/src/http.c
===================================================================
--- wget-1.18.orig/src/http.c
+++ wget-1.18/src/http.c
@@ -1516,6 +1516,7 @@ persistent_available_p (const char *host
active, registered connection". */
#define CLOSE_FINISH(fd) do { \
+ int errno_sav = errno; \
if (!keep_alive) \
{ \
if (pconn_active && (fd) == pconn.socket) \
@@ -1524,14 +1525,17 @@ persistent_available_p (const char *host
fd_close (fd); \
fd = -1; \
} \
+ errno = errno_sav; \
} while (0)
#define CLOSE_INVALIDATE(fd) do { \
+ int errno_sav = errno; \
if (pconn_active && (fd) == pconn.socket) \
invalidate_persistent (); \
else \
fd_close (fd); \
fd = -1; \
+ errno = errno_sav; \
} while (0)
struct http_stat