Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: [Patch] nsock/tests/tests_main.c
From: Gisle Vanem <gvanem () broadpark no>
Date: Wed, 07 Aug 2013 19:08:33 +0200

"Henri Doreau" <henri.doreau () gmail com> wrote:

I've committed the socket_strerror() part with a little change
(r31677).

Here is another misuse of perror(), i.e. strerror(). Which doesn't
print network errors on Windows. Since there's no socket_perror(),
I suggest this instead:

--- SVN-Latest/nsock/src/nsock_connect.c   2013-08-01 11:37:22 +0000
+++ nsock/src/nsock_connect.c        2013-08-07 11:16:43 +0000
  /* inheritable_socket is from nbase */
  iod->sd = (int)inheritable_socket(family, type, proto);
  if (iod->sd == -1) {
-    perror("Socket troubles");
+    printf("Socket troubles %s", socket_strerror(socket_errno()));
    return -1;
  }

----------

--gv
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]