VirtualBox

Ignore:
Timestamp:
Aug 19, 2016 7:54:19 AM (8 years ago)
Author:
vboxsync
Message:

Serial/Host: Don't try to kick off a thread to monitor the status lines if the device is a pseudo terminal as it doesn't support TIOMCGET

File:
1 edited

Legend:

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

    r63583 r63591  
    13201320#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    13211321    /* Linux & darwin needs a separate thread which monitors the status lines. */
    1322 # ifndef RT_OS_LINUX
    1323     ioctl(RTFileToNative(pThis->hDeviceFile), TIOCMGET, &pThis->fStatusLines);
    1324 # endif
    1325     rc = PDMDrvHlpThreadCreate(pDrvIns, &pThis->pMonitorThread, pThis, drvHostSerialMonitorThread, drvHostSerialWakeupMonitorThread, 0, RTTHREADTYPE_IO, "SerMon");
    1326     if (RT_FAILURE(rc))
    1327         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create monitor thread"), pDrvIns->iInstance);
     1322    int rcPsx = ioctl(RTFileToNative(pThis->hDeviceFile), TIOCMGET, &pThis->fStatusLines);
     1323    if (!rcPsx)
     1324    {
     1325        rc = PDMDrvHlpThreadCreate(pDrvIns, &pThis->pMonitorThread, pThis, drvHostSerialMonitorThread, drvHostSerialWakeupMonitorThread, 0, RTTHREADTYPE_IO, "SerMon");
     1326        if (RT_FAILURE(rc))
     1327            return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create monitor thread"), pDrvIns->iInstance);
     1328    }
     1329    else
     1330    {
     1331        /* TIOCMGET is not supported for pseudo terminals so just silently skip it. */
     1332        if (errno != ENOTTY)
     1333            PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail",
     1334                                       N_("Trying to get the status lines state failed for serial host device '%s' (%Rrc). The device will not work properly"),
     1335                                       pThis->pszDevicePath, RTErrConvertFromErrno(errno));
     1336    }
    13281337#endif
    13291338
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