Changeset 23973 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 22, 2009 12:34:22 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53801
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r23923 r23973 375 375 { 376 376 RTStrmPrintf(buff, sizeof(buff), "%s/RESOLV2", etc); 377 rc = RTFileOpen(&f, buff, RTFILE_O_READ );377 rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 378 378 } 379 379 if (RT_FAILURE(rc)) 380 380 { 381 381 RTStrmPrintf(buff, sizeof(buff), "%s/RESOLV2", _PATH_ETC); 382 rc = RTFileOpen(&f, buff, RTFILE_O_READ );382 rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 383 383 } 384 384 if (RT_FAILURE(rc)) 385 385 { 386 386 RTStrmPrintf(buff, sizeof(buff), "%s/resolv.conf", _PATH_ETC); 387 rc = RTFileOpen(&f, buff, RTFILE_O_READ );387 rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 388 388 } 389 389 #else 390 390 # ifndef DEBUG_vvl 391 rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ );391 rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 392 392 # else 393 393 char *home = getenv("HOME"); 394 394 RTStrPrintf(buff, sizeof(buff), "%s/resolv.conf", home); 395 rc = RTFileOpen(&f, buff, RTFILE_O_READ );395 rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 396 396 if (RT_SUCCESS(rc)) 397 397 { … … 400 400 else 401 401 { 402 rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ );402 rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 403 403 Log(("NAT: DNS we're using %s\n", buff)); 404 404 } … … 771 771 if (!link_up) 772 772 goto done; 773 773 774 774 /* 775 775 * *_slowtimo needs calling if there are IP fragments … … 804 804 if (pData->fmbuf_water_line == 1) 805 805 { 806 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 806 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 807 807 { 808 808 pData->fmbuf_water_warn_sent = 0; … … 887 887 if (pData->fmbuf_water_line == 1) 888 888 { 889 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 889 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 890 890 { 891 891 pData->fmbuf_water_line = 0; … … 1027 1027 if (pData->fmbuf_water_line == 1) 1028 1028 { 1029 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 1029 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 1030 1030 { 1031 1031 pData->fmbuf_water_line = 0; … … 1324 1324 if (pData->fmbuf_water_line == 1) 1325 1325 { 1326 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 1326 if (mbuf_alloced < pData->mbuf_water_line_limit/2) 1327 1327 { 1328 1328 pData->fmbuf_water_line = 0; … … 1549 1549 return; 1550 1550 } 1551 eh = mtod(m, struct ethhdr *); 1551 eh = mtod(m, struct ethhdr *); 1552 1552 proto = ntohs(eh->h_proto); 1553 1553 #else … … 1621 1621 #endif 1622 1622 #if 1 1623 if ( pData->fmbuf_water_line 1623 if ( pData->fmbuf_water_line 1624 1624 && pData->fmbuf_water_warn_sent == 0 1625 1625 && (curtime - pData->tsmbuf_water_warn_sent) > 500) 1626 1626 { 1627 icmp_error(pData, m, ICMP_SOURCEQUENCH, 0, 0, "Out of resources!!!"); 1627 icmp_error(pData, m, ICMP_SOURCEQUENCH, 0, 0, "Out of resources!!!"); 1628 1628 pData->fmbuf_water_warn_sent = 1; 1629 1629 pData->tsmbuf_water_warn_sent = curtime; -
trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp
r22277 r23973 260 260 /** 261 261 * Construct a host parallel driver instance. 262 * 262 * 263 263 * @copydoc FNPDMDRVCONSTRUCT 264 264 */ … … 303 303 * Open the device 304 304 */ 305 rc = RTFileOpen(&pThis->FileDevice, pThis->pszDevicePath, RTFILE_O_ OPEN | RTFILE_O_READWRITE);305 rc = RTFileOpen(&pThis->FileDevice, pThis->pszDevicePath, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 306 306 if (RT_FAILURE(rc)) 307 307 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Parallel#%d could not open '%s'"), … … 433 433 NULL, 434 434 /* pfnDetach */ 435 NULL, 435 NULL, 436 436 /* pfnPowerOff */ 437 NULL, 437 NULL, 438 438 /* pfnSoftReset */ 439 439 NULL, -
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r23160 r23973 1211 1211 /** 1212 1212 * Construct a char driver instance. 1213 * 1213 * 1214 1214 * @copydoc FNPDMDRVCONSTRUCT 1215 1215 */ … … 1288 1288 #else 1289 1289 1290 rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, RTFILE_O_ OPEN | RTFILE_O_READWRITE);1290 rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 1291 1291 # ifdef RT_OS_DARWIN 1292 1292 if (RT_SUCCESS(rc)) 1293 rc = RTFileOpen(&pThis->DeviceFileR, pThis->pszDevicePath, RTFILE_O_ OPEN | RTFILE_O_READ);1293 rc = RTFileOpen(&pThis->DeviceFileR, pThis->pszDevicePath, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 1294 1294 # endif 1295 1295 … … 1495 1495 NULL, 1496 1496 /* pfnDetach */ 1497 NULL, 1497 NULL, 1498 1498 /* pfnPowerOff */ 1499 NULL, 1499 NULL, 1500 1500 /* pfnSoftReset */ 1501 1501 NULL, -
trunk/src/VBox/Devices/Serial/DrvRawFile.cpp
r22653 r23973 150 150 * Open the raw file. 151 151 */ 152 rc = RTFileOpen(&pThis->OutputFile, pThis->pszLocation, RTFILE_O_ CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_NONE);152 rc = RTFileOpen(&pThis->OutputFile, pThis->pszLocation, RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_NONE); 153 153 if (RT_FAILURE(rc)) 154 154 { … … 180 180 181 181 if (pThis->OutputFile != NIL_RTFILE) 182 { 182 { 183 183 RTFileClose(pThis->OutputFile); 184 184 pThis->OutputFile = NIL_RTFILE; … … 200 200 201 201 if (pThis->OutputFile != NIL_RTFILE) 202 { 202 { 203 203 RTFileClose(pThis->OutputFile); 204 204 pThis->OutputFile = NIL_RTFILE; -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r23739 r23973 961 961 RTFILE FileDevice; 962 962 963 rc = RTFileOpen(&FileDevice, pThis->pszDeviceOpen, RTFILE_O_READWRITE );963 rc = RTFileOpen(&FileDevice, pThis->pszDeviceOpen, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 964 964 if (RT_FAILURE(rc)) 965 965 return rc; … … 983 983 RTFILE PassthroughDevice; 984 984 985 rc = RTFileOpen(&PassthroughDevice, pszPassthroughDevice, RTFILE_O_READWRITE );985 rc = RTFileOpen(&PassthroughDevice, pszPassthroughDevice, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 986 986 987 987 RTStrFree(pszPassthroughDevice); … … 1046 1046 static int drvHostBaseOpen(PDRVHOSTBASE pThis, PRTFILE pFileBlockDevice, PRTFILE pFileRawDevice, bool fReadOnly) 1047 1047 { 1048 unsigned fFlags = (fReadOnly ? RTFILE_O_READ : RTFILE_O_READWRITE) | RTFILE_O_NON_BLOCK; 1048 unsigned fFlags = (fReadOnly ? RTFILE_O_READ : RTFILE_O_READWRITE) 1049 | RTFILE_O_OPEN | RTFILE_O_DENY_NONE | RTFILE_O_NON_BLOCK; 1049 1050 int rc = RTFileOpen(pFileBlockDevice, pThis->pszDeviceOpen, fFlags); 1050 1051 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Devices/Storage/DrvSCSIHost.cpp
r23970 r23973 478 478 N_("Configuration error: Failed to get the \"DevicePath\" value")); 479 479 480 rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, RTFILE_O_ OPEN | RTFILE_O_READWRITE);480 rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 481 481 if (RT_FAILURE(rc)) 482 482 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, -
trunk/src/VBox/Devices/Storage/ParallelsHDDCore.cpp
r23223 r23973 143 143 144 144 #ifndef VBOX_WITH_NEW_IO_CODE 145 u nsigned uFileFlags= fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE146 145 uint32_t fOpen = fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE 146 : RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE; 147 147 148 148 if (fCreate) 149 uFileFlags|= RTFILE_O_CREATE;150 else 151 uFileFlags|= RTFILE_O_OPEN;152 153 rc = RTFileOpen(&pImage->File, pImage->pszFilename, uFileFlags);149 fOpen |= RTFILE_O_CREATE; 150 else 151 fOpen |= RTFILE_O_OPEN; 152 153 rc = RTFileOpen(&pImage->File, pImage->pszFilename, fOpen); 154 154 #else 155 155 … … 415 415 int rc; 416 416 417 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ );417 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 418 418 if (RT_FAILURE(rc)) 419 419 return VERR_VD_GEN_INVALID_HEADER; -
trunk/src/VBox/Devices/Storage/RawHDDCore.cpp
r23913 r23973 122 122 123 123 #ifndef VBOX_WITH_NEW_IO_CODE 124 u nsigned uFileFlags= fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE125 124 uint32_t fOpen = fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE 125 : RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE; 126 126 127 127 if (fCreate) 128 uFileFlags|= RTFILE_O_CREATE;129 else 130 uFileFlags|= RTFILE_O_OPEN;131 132 rc = RTFileOpen(&pImage->File, pImage->pszFilename, uFileFlags);128 fOpen |= RTFILE_O_CREATE; 129 else 130 fOpen |= RTFILE_O_OPEN; 131 132 rc = RTFileOpen(&pImage->File, pImage->pszFilename, fOpen); 133 133 #else 134 134 -
trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
r23223 r23973 738 738 pStorage->pfnCompleted = pfnCompleted; 739 739 740 u nsigned uFlags= 0;740 uint32_t fOpen = 0; 741 741 742 742 if (uOpenFlags & VD_INTERFACEASYNCIO_OPEN_FLAGS_READONLY) 743 uFlags |= RTFILE_O_READ| RTFILE_O_DENY_NONE;743 fOpen |= RTFILE_O_READ | RTFILE_O_DENY_NONE; 744 744 else 745 uFlags|= RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE;745 fOpen |= RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE; 746 746 747 747 if (uOpenFlags & VD_INTERFACEASYNCIO_OPEN_FLAGS_CREATE) 748 uFlags|= RTFILE_O_CREATE;748 fOpen |= RTFILE_O_CREATE; 749 749 else 750 uFlags|= RTFILE_O_OPEN;750 fOpen |= RTFILE_O_OPEN; 751 751 752 752 /* Open the file. */ 753 int rc = RTFileOpen(&pStorage->File, pszLocation, uFlags);753 int rc = RTFileOpen(&pStorage->File, pszLocation, fOpen); 754 754 if (RT_SUCCESS(rc)) 755 755 { -
trunk/src/VBox/Devices/Storage/VBoxHDDFormats/AppleDiskImage/VBoxDMG.cpp
r21405 r23973 1035 1035 */ 1036 1036 RTFILE hFile; 1037 int rc = RTFileOpen(&hFile, pszFilename, RTFILE_O_ OPEN | RTFILE_O_READ| RTFILE_O_DENY_WRITE);1037 int rc = RTFileOpen(&hFile, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE); 1038 1038 if (RT_FAILURE(rc)) 1039 1039 return rc; -
trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
r23223 r23973 89 89 90 90 #ifndef VBOX_WITH_NEW_IO_CODE 91 u nsigned uFileFlags= fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE92 91 uint32_t fOpen = fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE 92 : RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE; 93 93 94 94 if (fCreate) 95 uFileFlags|= RTFILE_O_CREATE;95 fOpen |= RTFILE_O_CREATE; 96 96 else 97 uFileFlags|= RTFILE_O_OPEN;98 99 rc = RTFileOpen(&pImage->File, pImage->pszFilename, uFileFlags);97 fOpen |= RTFILE_O_OPEN; 98 99 rc = RTFileOpen(&pImage->File, pImage->pszFilename, fOpen); 100 100 #else 101 101 -
trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp
r23223 r23973 226 226 227 227 #ifndef VBOX_WITH_NEW_IO_CODE 228 u nsigned uFileFlags= fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE229 228 uint32_t fOpen = fReadonly ? RTFILE_O_READ | RTFILE_O_DENY_NONE 229 : RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE; 230 230 231 231 if (fCreate) 232 uFileFlags|= RTFILE_O_CREATE;233 else 234 uFileFlags|= RTFILE_O_OPEN;235 236 rc = RTFileOpen(&pImage->File, pImage->pszFilename, uFileFlags);232 fOpen |= RTFILE_O_CREATE; 233 else 234 fOpen |= RTFILE_O_OPEN; 235 236 rc = RTFileOpen(&pImage->File, pImage->pszFilename, fOpen); 237 237 #else 238 238 … … 774 774 VHDFooter vhdFooter; 775 775 776 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN );776 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 777 777 if (RT_FAILURE(rc)) 778 778 return VERR_VD_VHD_INVALID_HEADER; … … 2015 2015 /* Interface doesn't provide such a feature. */ 2016 2016 RTFILE File; 2017 rc = RTFileOpen(&File, pImage->pszFilename, RTFILE_O_ OPEN | RTFILE_O_READ);2017 rc = RTFileOpen(&File, pImage->pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 2018 2018 if (RT_SUCCESS(rc)) 2019 2019 { -
trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp
r22982 r23973 100 100 { 101 101 RTFILE File; 102 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ );102 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 103 103 if (RT_SUCCESS(rc)) 104 104 { … … 153 153 VDClose(pVD, true); 154 154 RTFILE File; 155 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ );155 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 156 156 if (RT_SUCCESS(rc)) 157 157 { … … 535 535 536 536 RTFILE File; 537 rc = RTFileOpen(&File, pszBaseFilename, RTFILE_O_READ );537 rc = RTFileOpen(&File, pszBaseFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 538 538 if (RT_SUCCESS(rc)) 539 539 { … … 658 658 659 659 RTFILE File; 660 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ );660 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 661 661 if (RT_SUCCESS(rc)) 662 662 { … … 827 827 828 828 RTFILE File; 829 rc = RTFileOpen(&File, DST_PATH, RTFILE_O_ CREATE | RTFILE_O_WRITE);829 rc = RTFileOpen(&File, DST_PATH, RTFILE_O_WRITE | RTFILE_O_CREATE | RTFILE_O_DENY_NONE); 830 830 if (RT_SUCCESS(rc)) 831 831 RTFileClose(File);
Note:
See TracChangeset
for help on using the changeset viewer.