Changeset 55956 in vbox
- Timestamp:
- May 20, 2015 12:14:28 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vd.h
r54835 r55956 265 265 * 266 266 * @return RTFile open flags. 267 * @param uOpenFlags VD_OPEN_FLAGS_* open flags.267 * @param fOpenFlags VD_OPEN_FLAGS_* open flags. 268 268 * @param fCreate Flag that the file should be created. 269 269 */ 270 DECLINLINE(uint32_t) VDOpenFlagsToFileOpenFlags(unsigned uOpenFlags, bool fCreate)270 DECLINLINE(uint32_t) VDOpenFlagsToFileOpenFlags(unsigned fOpenFlags, bool fCreate) 271 271 { 272 AssertMsg(!((uOpenFlags & VD_OPEN_FLAGS_READONLY) && fCreate), ("Image can't be opened readonly while being created\n")); 273 274 uint32_t fOpen = 0; 275 276 if (RT_UNLIKELY(uOpenFlags & VD_OPEN_FLAGS_READONLY)) 277 fOpen |= RTFILE_O_READ | RTFILE_O_DENY_NONE; 272 AssertMsg(!(fOpenFlags & VD_OPEN_FLAGS_READONLY) || !fCreate, ("Image can't be opened readonly while being created\n")); 273 274 uint32_t fOpen; 275 if (fOpenFlags & VD_OPEN_FLAGS_READONLY) 276 fOpen = RTFILE_O_READ | RTFILE_O_DENY_NONE; 278 277 else 279 278 { 280 fOpen |= RTFILE_O_READWRITE;281 282 if ( RT_UNLIKELY(uOpenFlags & VD_OPEN_FLAGS_SHAREABLE))279 fOpen = RTFILE_O_READWRITE; 280 281 if (fOpenFlags & VD_OPEN_FLAGS_SHAREABLE) 283 282 fOpen |= RTFILE_O_DENY_NONE; 284 283 else … … 286 285 } 287 286 288 if (RT_UNLIKELY(fCreate)) 287 if (!fCreate) 288 fOpen |= RTFILE_O_OPEN; 289 else 289 290 fOpen |= RTFILE_O_CREATE | RTFILE_O_NOT_CONTENT_INDEXED; 290 else291 fOpen |= RTFILE_O_OPEN;292 291 293 292 return fOpen;
Note:
See TracChangeset
for help on using the changeset viewer.