Changeset 1798 for trunk/src


Ignore:
Timestamp:
Nov 21, 1999, 4:22:18 PM (26 years ago)
Author:
phaller
Message:

Fix: few error handling issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/wsock32.cpp

    r1691 r1798  
    1 /* $Id: wsock32.cpp,v 1.13 1999-11-10 16:39:46 phaller Exp $ */
     1/* $Id: wsock32.cpp,v 1.14 1999-11-21 15:22:18 phaller Exp $ */
    22
    33/*
     
    9292#endif
    9393
    94 
    95 // forwarder prototypes
    96 void _System SetLastError(int iError);
    97 int  _System GetLastError(void);
    9894
    9995
     
    128124 * Local variables                                                           *
    129125 *****************************************************************************/
    130 
    131 // @@@PH not reentrancy proof
    132 //<_sandervl> phs: I already have a rewrite of the error support in wsock. Use the
    133 //            GetThreadTHDB export in kernel32 and add a DWORD to the thread
    134 //            structure in include\win\thread.h
    135126
    136127typedef struct tagWsockThreadData
     
    983974                                 int,   namelen)
    984975{
    985   return gethostname(name,namelen);
     976  int rc = gethostname(name,namelen);
     977 
     978  if (rc == SOCKET_ERROR)
     979    WSASetLastError(ERROR_SUCCESS);
     980  else
     981    WSASetLastError(iTranslateSockErrToWSock(sock_errno()));
     982 
     983  return (rc);
    986984}
    987985
     
    11921190  }
    11931191  else
    1194     return(iTranslateSockErrToWSock(sock_errno()));
     1192  {
     1193    WSASetLastError(iTranslateSockErrToWSock(sock_errno()));
     1194    return(WSASYSNOTREADY);
     1195  }
    11951196}
    11961197
     
    12101211ODINFUNCTION0(int,OS2WSACleanup)
    12111212{
     1213  WSASetLastError(ERROR_SUCCESS);
    12121214  return 0;
    12131215}
Note: See TracChangeset for help on using the changeset viewer.