[1/9] winhttp: Avoid testing errno when it isn't set.

Hans Leidekker hans at codeweavers.com
Wed Sep 3 05:29:45 CDT 2008


The series has grown from 7 to 9 patches and I removed a test
from patch 5 that depended on a registry setting.

 -Hans

diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c
index d367723..90950cb 100644
--- a/dlls/winhttp/net.c
+++ b/dlls/winhttp/net.c
@@ -524,9 +524,10 @@ BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen )
     {
         if (poll( &pfd, 1, DEFAULT_RECEIVE_TIMEOUT * 1000 ) > 0)
         {
-            if (recv( conn->socket, &buffer[recvd], 1, 0 ) <= 0)
+            int res;
+            if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0)
             {
-                set_last_error( sock_get_error( errno ) );
+                if (res == -1) set_last_error( sock_get_error( errno ) );
                 break;
             }
             if (buffer[recvd] == '\n')



More information about the wine-patches mailing list