Ignore:
Timestamp:
Oct 27, 1999, 10:38:05 AM (26 years ago)
Author:
phaller
Message:

Fix: error codes for async operations

File:
1 edited

Legend:

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

    r1460 r1468  
    1 /* $Id: async.cpp,v 1.9 1999-10-26 21:43:00 phaller Exp $ */
     1/* $Id: async.cpp,v 1.10 1999-10-27 08:38:03 phaller Exp $ */
    22
    33/*
     
    6262                       struct timeval);
    6363
     64// wsock32.cpp: error code translation
     65int iTranslateSockErrToWSock(int iError);
    6466
    6567
     
    634636    if (pHostent == NULL) // error ?
    635637    {
    636       rc = sock_errno();   // assuming OS/2 return codes are
    637       WSASetLastError(rc); // same as Winsock return codes
     638      // build error return code
     639      rc = iTranslateSockErrToWSock(sock_errno());
     640      WSASetLastError(rc);
    638641    }
    639642    else
     
    694697    if (pHostent == NULL) // error ?
    695698    {
    696       rc = sock_errno();   // assuming OS/2 return codes are
    697       WSASetLastError(rc); // same as Winsock return codes
    698 
    699       dprintf (("  pHostent==NULL -> rc=%d\n", rc));
     699      // build error return code
     700      rc = iTranslateSockErrToWSock(sock_errno());
     701      WSASetLastError(rc);
    700702    }
    701703    else
     
    756758    if (pProtoent == NULL) // error ?
    757759    {
    758       rc = sock_errno();   // assuming OS/2 return codes are
    759       WSASetLastError(rc); // same as Winsock return codes
     760      // build error return code
     761      rc = iTranslateSockErrToWSock(sock_errno());
     762      WSASetLastError(rc);
    760763    }
    761764    else
     
    814817    if (pProtoent == NULL) // error ?
    815818    {
    816       rc = sock_errno();   // assuming OS/2 return codes are
    817       WSASetLastError(rc); // same as Winsock return codes
     819      // build error return code
     820      rc = iTranslateSockErrToWSock(sock_errno());
     821      WSASetLastError(rc);
    818822    }
    819823    else
     
    873877    if (pServent == NULL) // error ?
    874878    {
    875       rc = sock_errno();   // assuming OS/2 return codes are
    876       WSASetLastError(rc); // same as Winsock return codes
     879      // build error return code
     880      rc = iTranslateSockErrToWSock(sock_errno());
     881      WSASetLastError(rc);
    877882    }
    878883    else
     
    933938    if (pServent == NULL) // error ?
    934939    {
    935       rc = sock_errno();   // assuming OS/2 return codes are
    936       WSASetLastError(rc); // same as Winsock return codes
     940      // build error return code
     941      rc = iTranslateSockErrToWSock(sock_errno());
     942      WSASetLastError(rc);
    937943    }
    938944    else
     
    10131019    if (irc == 0)                                      /* this means timeout */
    10141020    {
    1015       lParam = WSAETIMEDOUT;                        /* raise error condition */
     1021      lParam = iTranslateSockErrToWSock(WSAETIMEDOUT);/* raise error condition */
    10161022    }
    10171023    else
Note: See TracChangeset for help on using the changeset viewer.