From 5e8f88194d32f190793ccae4c93df3ff0c84884e Mon Sep 17 00:00:00 2001 From: david Date: Tue, 2 Mar 2010 18:29:22 +0000 Subject: [PATCH] Use socket_errno() instead of errno in NSE raw socket code, to get Windows errors. --- nse_nsock.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nse_nsock.cc b/nse_nsock.cc index 0907beaf0..24700f385 100644 --- a/nse_nsock.cc +++ b/nse_nsock.cc @@ -2070,7 +2070,7 @@ static int l_dnet_open_ip(lua_State * L) if (udata->sock == -1) { lua_pushboolean(L, false); - lua_pushfstring(L, "Failed to open raw socket: %s (errno %d)", socket_strerror(errno), errno); + lua_pushfstring(L, "Failed to open raw socket: %s (errno %d)", socket_strerror(socket_errno()), socket_errno()); return 2; } @@ -2198,7 +2198,7 @@ usesock: } if (ret == -1) { lua_pushboolean(L, false); - lua_pushfstring(L, "Error while sending: %s (errno %d)", socket_strerror(errno), errno); + lua_pushfstring(L, "Error while sending: %s (errno %d)", socket_strerror(socket_errno()), socket_errno()); return 2; } lua_pushboolean(L, true);