diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index 81874313d7..436e21f8a2 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -302,9 +302,12 @@ httpAddrConnect2( // check the SO_ERROR value and ignore the POLLHUP if there is no error or // the error is EINPROGRESS. - int sres, serr; - socklen_t slen = sizeof(serr); + int sres, /* Return value from getsockopt() - 0, or -1 if error */ + serr; /* Option SO_ERROR value */ + socklen_t slen = sizeof(serr); /* Option value size */ + sres = getsockopt(fds[i], SOL_SOCKET, SO_ERROR, &serr, &slen); + if (sres || serr) { pfds[i].revents |= POLLERR;