diff options
Diffstat (limited to 'src/VBox/Runtime/r3/darwin/filelock-darwin.cpp')
-rw-r--r-- | src/VBox/Runtime/r3/darwin/filelock-darwin.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp b/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp index f588963e1..614095074 100644 --- a/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp +++ b/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp @@ -1,10 +1,10 @@ -/* $Id: filelock-darwin.cpp $ */ +/* $Id: filelock-darwin.cpp 37597 2011-06-22 20:54:05Z vboxsync $ */ /** @file * IPRT - File Locking, POSIX. */ /* - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -49,7 +49,7 @@ -RTR3DECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock) +RTR3DECL(int) RTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock) { Assert(offLock >= 0); @@ -82,7 +82,7 @@ RTR3DECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t fl.l_pid = 0; Assert(RTFILE_LOCK_WAIT); - if (fcntl(File, (fLock & RTFILE_LOCK_WAIT) ? F_SETLKW : F_SETLK, &fl) >= 0) + if (fcntl(RTFileToNative(hFile), (fLock & RTFILE_LOCK_WAIT) ? F_SETLKW : F_SETLK, &fl) >= 0) return VINF_SUCCESS; int iErr = errno; if (iErr == ENOTSUP) @@ -101,7 +101,7 @@ RTR3DECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t f |= LOCK_EX; else f |= LOCK_SH; - if (!flock(File, f)) + if (!flock(RTFileToNative(hFile), f)) return VINF_SUCCESS; iErr = errno; if (iErr == EWOULDBLOCK) @@ -116,14 +116,14 @@ RTR3DECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t } -RTR3DECL(int) RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock) +RTR3DECL(int) RTFileChangeLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock) { /** @todo We never returns VERR_FILE_NOT_LOCKED for now. */ - return RTFileLock(File, fLock, offLock, cbLock); + return RTFileLock(hFile, fLock, offLock, cbLock); } -RTR3DECL(int) RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock) +RTR3DECL(int) RTFileUnlock(RTFILE hFile, int64_t offLock, uint64_t cbLock) { Assert(offLock >= 0); @@ -147,14 +147,14 @@ RTR3DECL(int) RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock) fl.l_len = (off_t)cbLock; fl.l_pid = 0; - if (fcntl(File, F_SETLK, &fl) >= 0) + if (fcntl(RTFileToNative(hFile), F_SETLK, &fl) >= 0) return VINF_SUCCESS; int iErr = errno; if (iErr == ENOTSUP) { /* A SMB hack, see RTFileLock. */ - if (!flock(File, LOCK_UN)) + if (!flock(RTFileToNative(hFile), LOCK_UN)) return VINF_SUCCESS; } |