vbox的更動 37597 路徑 trunk/src/VBox/Runtime/r3/darwin
- 時間撮記:
- 2011-6-22 下午08:54:05 (13 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp
r28800 r37597 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 50 50 51 51 52 RTR3DECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock)52 RTR3DECL(int) RTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock) 53 53 { 54 54 Assert(offLock >= 0); … … 83 83 84 84 Assert(RTFILE_LOCK_WAIT); 85 if (fcntl( File, (fLock & RTFILE_LOCK_WAIT) ? F_SETLKW : F_SETLK, &fl) >= 0)85 if (fcntl(RTFileToNative(hFile), (fLock & RTFILE_LOCK_WAIT) ? F_SETLKW : F_SETLK, &fl) >= 0) 86 86 return VINF_SUCCESS; 87 87 int iErr = errno; … … 102 102 else 103 103 f |= LOCK_SH; 104 if (!flock( File, f))104 if (!flock(RTFileToNative(hFile), f)) 105 105 return VINF_SUCCESS; 106 106 iErr = errno; … … 117 117 118 118 119 RTR3DECL(int) RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock)119 RTR3DECL(int) RTFileChangeLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock) 120 120 { 121 121 /** @todo We never returns VERR_FILE_NOT_LOCKED for now. */ 122 return RTFileLock( File, fLock, offLock, cbLock);122 return RTFileLock(hFile, fLock, offLock, cbLock); 123 123 } 124 124 125 125 126 RTR3DECL(int) RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock)126 RTR3DECL(int) RTFileUnlock(RTFILE hFile, int64_t offLock, uint64_t cbLock) 127 127 { 128 128 Assert(offLock >= 0); … … 148 148 fl.l_pid = 0; 149 149 150 if (fcntl( File, F_SETLK, &fl) >= 0)150 if (fcntl(RTFileToNative(hFile), F_SETLK, &fl) >= 0) 151 151 return VINF_SUCCESS; 152 152 … … 155 155 { 156 156 /* A SMB hack, see RTFileLock. */ 157 if (!flock( File, LOCK_UN))157 if (!flock(RTFileToNative(hFile), LOCK_UN)) 158 158 return VINF_SUCCESS; 159 159 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器