X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fgnutls.c;fp=src%2Fgnutls.c;h=442b1364a311b34fd171dd51302ab99c06b863b2;hp=2db5a90c5806d65b6d45eaf9b1dc45e66ed0416b;hb=b30ba732ade43b231f4fe6693f1f833b36f7ffe2;hpb=3bb17fca04e792fe9668365e2c2af43fdbedafea diff --git a/src/gnutls.c b/src/gnutls.c index 2db5a90c..442b1364 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -175,15 +175,13 @@ wgnutls_read_timeout (int fd, char *buf, int bufsize, void *arg, double timeout) if (timeout) { #ifdef F_GETFL - ret = fcntl (fd, F_SETFL, flags | O_NONBLOCK); - if (ret < 0) - return ret; + if (fcntl (fd, F_SETFL, flags | O_NONBLOCK)) + break; #else /* XXX: Assume it was blocking before. */ const int one = 1; - ret = ioctl (fd, FIONBIO, &one); - if (ret < 0) - return ret; + if (ioctl (fd, FIONBIO, &one) < 0) + break; #endif } @@ -191,16 +189,13 @@ wgnutls_read_timeout (int fd, char *buf, int bufsize, void *arg, double timeout) if (timeout) { - int status; #ifdef F_GETFL - status = fcntl (fd, F_SETFL, flags); - if (status < 0) - return status; + if (fcntl (fd, F_SETFL, flags) < 0) + break; #else const int zero = 0; - status = ioctl (fd, FIONBIO, &zero); - if (status < 0) - return status; + if (ioctl (fd, FIONBIO, &zero) < 0) + break; #endif } }