]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
httpc: fix for the previous commit
authorJaroslav Kysela <perex@perex.cz>
Tue, 10 Jun 2014 13:07:58 +0000 (15:07 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 10 Jun 2014 13:07:58 +0000 (15:07 +0200)
src/httpc.c

index d6b6129a29e04f1ed708d286651dea3bb0d52aa1..1e1f20600ac5f265a408d5feb9b629eb14ac8a12 100644 (file)
@@ -470,12 +470,13 @@ http_client_send_partial( http_client_t *hc )
     if (hc->hc_einprogress) {
       /* this seems like OSX specific issue */
       /* send() in the EINPROGRESS state closes the file-descriptor */
-      int err;
+      int err = 0;
       socklen_t errlen = sizeof(err);
-      r = 0;
       getsockopt(hc->hc_fd, SOL_SOCKET, SO_ERROR, (void *)&err, &errlen);
-      if (err == EINPROGRESS)
+      if (err == EINPROGRESS) {
+        r = err;
         goto skip;
+      }
       hc->hc_einprogress = 0;
     }
     if (hc->hc_ssl)