VirtualBox

Ignore:
Timestamp:
Sep 25, 2009 4:28:23 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52859
Message:

AIO/Posix: Fix error code conversion on Darwin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/fileaio-posix.cpp

    r23340 r23342  
    558558                {
    559559                    pReqInt = pahReqs[i];
     560
    560561                    rcPosix = aio_error(&pReqInt->AioCB);
     562                    Assert(rcPosix != 0);
     563
    561564                    if (rcPosix != EINPROGRESS)
    562565                    {
     
    570573                            /* An error occurred. */
    571574                            RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
     575
     576                            /*
     577                             * Looks like Apple and glibc interpret the standard in different ways.
     578                             * glibc returns the error code which would be in errno but Apple returns
     579                             * -1 and sets errno to the appropriate value
     580                             */
     581#if defined(RT_OS_DARWIN)
     582                            Assert(rcPosix == -1)
     583                            pReqInt->Rc = RTErrConvertFromErrno(errno);
     584#elif defined(RT_OS_LINUX)
    572585                            pReqInt->Rc = RTErrConvertFromErrno(rcPosix);
     586#endif
    573587                            pReqInt->cbTransfered = 0;
    574588                        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette