diff options
author | drh <drh@noemail.net> | 2007-08-31 18:34:59 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-08-31 18:34:59 +0000 |
commit | 9e33c2c108084cb7722004df9d0c0c8597ab87fb (patch) | |
tree | f62c35afd2271073385c8ed61818352a3d0636be /src/os_unix.c | |
parent | e6a58a4e2a71f9d1b9a0680db9c0ed576b6b4d05 (diff) | |
download | sqlite-9e33c2c108084cb7722004df9d0c0c8597ab87fb.tar.gz sqlite-9e33c2c108084cb7722004df9d0c0c8597ab87fb.zip |
Remove the xLockState method for sqlite3_io_methods. Replace it with
a defined call to xFileControl(). This simplifies the interface and
also gives us coverage testing of sqlite3_file_control(). (CVS 4355)
FossilOrigin-Name: 306586c412b87c6d12bac796641517afa3f9eb6a
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 54674f7c7..b74e9f1d6 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2016,21 +2016,19 @@ static int nolockUnixClose(sqlite3_file *id) { /* -** No xFileControl opcodes are implemented by this VFS. +** Information and control of an open file handle. */ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ + switch( op ){ + case SQLITE_FCNTL_LOCKSTATE: { + *(int*)pArg = ((unixFile*)id)->locktype; + return SQLITE_OK; + } + } return SQLITE_ERROR; } /* -** Return an integer that indices the type of lock currently held -** by this handle. (Used for testing and analysis only.) -*/ -static int unixLockState(sqlite3_file *id){ - return ((unixFile*)id)->locktype; -} - -/* ** Return the sector size in bytes of the underlying block device for ** the specified file. This is almost always 512 bytes, but may be ** larger for some devices. @@ -2066,7 +2064,6 @@ static const sqlite3_io_methods sqlite3UnixIoMethod = { unixLock, unixUnlock, unixCheckReservedLock, - unixLockState, unixFileControl, unixSectorSize, unixDeviceCharacteristics @@ -2088,7 +2085,6 @@ static const sqlite3_io_methods sqlite3AFPLockingUnixIoMethod = { afpUnixLock, afpUnixUnlock, afpUnixCheckReservedLock, - unixLockState, unixFileControl, unixSectorSize, unixDeviceCharacteristics @@ -2109,7 +2105,6 @@ static const sqlite3_io_methods sqlite3FlockLockingUnixIoMethod = { flockUnixLock, flockUnixUnlock, flockUnixCheckReservedLock, - unixLockState, unixFileControl, unixSectorSize, unixDeviceCharacteristics @@ -2130,7 +2125,6 @@ static const sqlite3_io_methods sqlite3DotlockLockingUnixIoMethod = { dotlockUnixLock, dotlockUnixUnlock, dotlockUnixCheckReservedLock, - unixLockState, unixFileControl, unixSectorSize, unixDeviceCharacteristics @@ -2151,7 +2145,6 @@ static const sqlite3_io_methods sqlite3NolockLockingUnixIoMethod = { nolockUnixLock, nolockUnixUnlock, nolockUnixCheckReservedLock, - unixLockState, unixFileControl, unixSectorSize, unixDeviceCharacteristics |