VirtualBox

Changeset 33728 in vbox


Ignore:
Timestamp:
Nov 3, 2010 2:05:37 PM (14 years ago)
Author:
vboxsync
Message:

Serial/DrvHostSerial: on Linux, try to open the serial device in non-blocking mode, fixes public ticket 5756

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r33595 r33728  
    13601360    }
    13611361
    1362 #else
    1363 
    1364     rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
     1362#else /* !RT_OS_WINDOWS */
     1363
     1364    uint32_t fOpen = RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE;
     1365# ifdef RT_OS_LINUX
     1366    /* This seems to be necessary on some Linux hosts, otherwise we hang here forever.
     1367     * Surprisingly, I've never seen VERR_TRY_AGAIN as result even if RTFileOpen()
     1368     * would block without that flag. */
     1369    fOpen |= RTFILE_O_NON_BLOCK;
     1370# endif
     1371    rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, fOpen);
     1372# ifdef RT_OS_LINUX
     1373    if (rc == VERR_INVALID_PARAMETER)
     1374        rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, fOpen & ~RTFILE_O_NON_BLOCK);
     1375# endif
    13651376# ifdef RT_OS_DARWIN
    13661377    if (RT_SUCCESS(rc))
     
    13691380
    13701381
    1371 #endif
     1382#endif /* !RT_OS_WINDOWS */
    13721383
    13731384    if (RT_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

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