From 2810ecbd370c15886dddb4563ae1a8e27ba161f3 Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 28 Sep 2006 13:04:42 +0000 Subject: [PATCH] Allow to save the errno before it gets erased by another thread, and do so both on lin and win git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2831 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/portable.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/portable.h b/src/portable.h index 835de982df..3676725399 100644 --- a/src/portable.h +++ b/src/portable.h @@ -66,8 +66,8 @@ # undef sock_errno # undef sock_errstr -# define sock_errno WSAGetLastError() -# define sock_errstr gras_wsa_err2string(WSAGetLastError()) +# define sock_errno WSAGetLastError() +# define sock_errstr(err) gras_wsa_err2string(err) const char *gras_wsa_err2string(int errcode); @@ -77,8 +77,8 @@ const char *gras_wsa_err2string(int errcode); #else # define tcp_read( s, buf, len) read( s, buf, len ) # define tcp_write( s, buf, len) write( s, buf, len ) -# define sock_errno errno -# define sock_errstr strerror(errno) +# define sock_errno errno +# define sock_errstr(err) strerror(err) # ifdef SHUT_RDWR # define tcp_close( s ) (shutdown( s, SHUT_RDWR ), close( s )) -- 2.20.1