]> arthur.barton.de Git - netatalk.git/commitdiff
Specify option length in call to getsockopt and give connect 5 s
authorFrank Lahm <franklahm@googlemail.com>
Thu, 14 Oct 2010 12:59:40 +0000 (14:59 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 14 Oct 2010 12:59:40 +0000 (14:59 +0200)
libatalk/cnid/dbd/cnid_dbd.c

index 47049d0ff9ec20b9a49d0b4c2a4c3bd99b99a445..619a00e2aa17d12498235aa6e2db965dd4d7fac7 100644 (file)
@@ -110,7 +110,7 @@ static int tsock_getfd(const char *host, const char *port)
             if (errno == EINPROGRESS) {
                 struct timeval tv;
                 tv.tv_usec = 0;
-                tv.tv_sec  = 1; /* give it one second ... */
+                tv.tv_sec  = 5; /* give it five seconds ... */
                 fd_set wfds;
                 FD_ZERO(&wfds);
                 FD_SET(sock, &wfds);
@@ -123,7 +123,7 @@ static int tsock_getfd(const char *host, const char *port)
                     continue;
                 }
                 int optval;
-                socklen_t optlen;
+                socklen_t optlen = sizeof(optval);
                 if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &optval, &optlen) != 0 || optval != 0) {
                     /* somethings still wrong */
                     LOG(log_error, logtype_cnid, "getfd: getsockopt error with CNID server %s: %s",