Fixed connection error code returning.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 10 Jun 2007 07:21:06 +0000 (07:21 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 10 Jun 2007 07:21:06 +0000 (07:21 +0000)
lib/configure.ad
lib/silcutil/unix/silcunixnet.c

index 5c8701be279b95673fb9b3a9c3d8db30df886072..56df49e36ee233c2e8a5dee839835b778721555d 100644 (file)
@@ -85,7 +85,7 @@ LIB_BASE_VERSION=1.1
 # libsilc versions
 LIBSILC_CURRENT=2              # prev = 1
 LIBSILC_REVISION=0             # prev = 0
-LIBSILC_AGE=1                  # prev = 0
+LIBSILC_AGE=0                  # prev = 0
 
 # libsilcclient versions
 LIBSILCCLIENT_CURRENT=1                # prev = 1
index 706af5c0421ae0236977f58100987542b19be2ae..96a2e37cc59bee438507c247ded9e776dc1baf52 100644 (file)
@@ -628,20 +628,20 @@ SILC_FSM_STATE(silc_net_connect_st_connected)
     }
 
 #if defined(ECONNREFUSED)
-    if (errno == ECONNREFUSED)
+    if (opt == ECONNREFUSED)
       conn->status = SILC_NET_CONNECTION_REFUSED;
 #endif /* ECONNREFUSED */
 #if defined(ETIMEDOUT)
-    if (errno == ETIMEDOUT)
+    if (opt == ETIMEDOUT)
       conn->status = SILC_NET_CONNECTION_TIMEOUT;
 #endif /* ETIMEDOUT */
 #if defined(ENETUNREACH)
-    if (errno == ENETUNREACH)
+    if (opt == ENETUNREACH)
       conn->status = SILC_NET_HOST_UNREACHABLE;
 #endif /* ENETUNREACH */
 
     /** Connecting failed */
-    SILC_LOG_DEBUG(("Connecting failed"));
+    SILC_LOG_DEBUG(("Connecting failed, error %s", strerror(opt)));
     silc_fsm_next(fsm, silc_net_connect_st_finish);
     return SILC_FSM_CONTINUE;
   }