libs/nixio: cancel pending alarm after successfully returning from getnameinfo()
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 27 Aug 2012 14:54:07 +0000 (14:54 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 27 Aug 2012 14:54:07 +0000 (14:54 +0000)
libs/nixio/src/address.c

index a9759ea..d4f13d7 100644 (file)
@@ -336,7 +336,10 @@ static int nixio_getnameinfo(lua_State *L) {
 
 #ifdef __linux__
        if (timeout > 0 && timeout < 1000)
 
 #ifdef __linux__
        if (timeout > 0 && timeout < 1000)
+       {
+               ualarm(0);
                sigaction(SIGALRM, &sa_old, NULL);
                sigaction(SIGALRM, &sa_old, NULL);
+       }
 #endif
 
        if (res) {
 #endif
 
        if (res) {