diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Devices/Parallel/DrvHostParallel.cpp | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Devices/Parallel/DrvHostParallel.cpp')
-rw-r--r-- | src/VBox/Devices/Parallel/DrvHostParallel.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/VBox/Devices/Parallel/DrvHostParallel.cpp b/src/VBox/Devices/Parallel/DrvHostParallel.cpp index d0ea08de..60e19c54 100644 --- a/src/VBox/Devices/Parallel/DrvHostParallel.cpp +++ b/src/VBox/Devices/Parallel/DrvHostParallel.cpp @@ -872,23 +872,35 @@ static DECLCALLBACK(void) drvHostParallelDestruct(PPDMDRVINS pDrvIns) if (pThis->hFileDevice != NIL_RTFILE) ioctl(RTFileToNative(pThis->hFileDevice), PPRELEASE); - rc = RTPipeClose(pThis->hWakeupPipeW); AssertRC(rc); - pThis->hWakeupPipeW = NIL_RTPIPE; + if (pThis->hWakeupPipeW != NIL_RTPIPE) + { + rc = RTPipeClose(pThis->hWakeupPipeW); AssertRC(rc); + pThis->hWakeupPipeW = NIL_RTPIPE; + } - rc = RTPipeClose(pThis->hWakeupPipeR); AssertRC(rc); - pThis->hWakeupPipeR = NIL_RTPIPE; + if (pThis->hWakeupPipeR != NIL_RTPIPE) + { + rc = RTPipeClose(pThis->hWakeupPipeR); AssertRC(rc); + pThis->hWakeupPipeR = NIL_RTPIPE; + } - rc = RTFileClose(pThis->hFileDevice); AssertRC(rc); - pThis->hFileDevice = NIL_RTFILE; + if (pThis->hFileDevice != NIL_RTFILE) + { + rc = RTFileClose(pThis->hFileDevice); AssertRC(rc); + pThis->hFileDevice = NIL_RTFILE; + } if (pThis->pszDevicePath) { MMR3HeapFree(pThis->pszDevicePath); pThis->pszDevicePath = NULL; } -#else /* VBOX_WITH_WIN_PARPORT_SUP */ +#else /* VBOX_WITH_WIN_PARPORT_SUP */ if (pThis->hWinFileDevice != NIL_RTFILE) + { rc = RTFileClose(pThis->hWinFileDevice); AssertRC(rc); + pThis->hWinFileDevice = NIL_RTFILE; + } #endif /* VBOX_WITH_WIN_PARPORT_SUP */ } @@ -913,7 +925,7 @@ static DECLCALLBACK(int) drvHostParallelConstruct(PPDMDRVINS pDrvIns, PCFGMNODE #ifndef VBOX_WITH_WIN_PARPORT_SUP pThis->hWakeupPipeR = NIL_RTPIPE; pThis->hWakeupPipeW = NIL_RTPIPE; -#else /* VBOX_WITH_WIN_PARPORT_SUP */ +#else pThis->hWinFileDevice = NIL_RTFILE; #endif @@ -1010,7 +1022,6 @@ static DECLCALLBACK(int) drvHostParallelConstruct(PPDMDRVINS pDrvIns, PCFGMNODE return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostParallel#%d cannot create monitor thread"), pDrvIns->iInstance); #else /* VBOX_WITH_WIN_PARPORT_SUP */ - HANDLE hPort; pThis->fParportAvail = false; pThis->u32LptAddr = 0; pThis->u32LptAddrControl = 0; @@ -1086,4 +1097,3 @@ const PDMDRVREG g_DrvHostParallel = }; #endif /*IN_RING3*/ - |