-C Additional\stest\scases\sfor\scomparisons\sagainst\sNULL\sin\sthe\sWHERE\sclause\nand\selsewhere\sin\sa\sSELECT.\s(CVS\s4051)
-D 2007-06-08T08:43:10
+C Use\sC-sylte\scomments\sexclusively,\snever\sC++\scomments.\s\sTicket\s#2406.\s(CVS\s4052)
+D 2007-06-08T18:27:03
F Makefile.in a42354804b50c2708ce72cf79e4daa30f50191b5
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3
F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
-F src/os_unix.c cb1fb044b84870c7b1b8b2902e9d7be779f8b7ce
+F src/os_unix.c f2ccf2e9a925fc679faf7a8fe85700e0f13cf0e1
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 11ee8ea43f20f6146f4e4fcd9299468b3a99f998
-R 05a9a5f63d57dfcd13c111df92ba4c0c
+P 72612a0373c7abf8aadfdeb46358c0b0ae7b07a0
+R 4a0de78da8c062d2f4e8738bd1c4d8d0
U drh
-Z 2f14a325dddcad80036ac767af210cc8
+Z c63d7a71f7409006622c28c29603bd15
return unsupportedLockingStyle;
return sqlite3TestLockingStyle(filePath, fd);
-#endif // SQLITE_FIXED_LOCKING_STYLE
+#endif /* SQLITE_FIXED_LOCKING_STYLE */
}
#endif /* SQLITE_ENABLE_LOCKING_STYLE */
if ( err==-1 ) {
OSTRACE4("AFPLOCK failed to fsctl() '%s' %d %s\n", path, errno,
strerror(errno));
- return 1; // error
+ return 1; /* error */
} else {
return 0;
}
/* Otherwise see if some other process holds it.
*/
if ( !r ) {
- // lock the byte
+ /* lock the byte */
int failed = _AFPFSSetLock(context->filePath, pFile->h, RESERVED_BYTE, 1,1);
if (failed) {
/* if we failed to get the lock then someone else must have it */
unixFile *pFile = (unixFile*)id;
if (pFile->locktype == RESERVED_LOCK) {
- return 1; // already have a reserved lock
+ return 1; /* already have a reserved lock */
} else {
- // attempt to get the lock
+ /* attempt to get the lock */
int rc = flock(pFile->h, LOCK_EX | LOCK_NB);
if (!rc) {
- // got the lock, unlock it
+ /* got the lock, unlock it */
flock(pFile->h, LOCK_UN);
- return 0; // no one has it reserved
+ return 0; /* no one has it reserved */
}
- return 1; // someone else might have it reserved
+ return 1; /* someone else might have it reserved */
}
}
static int flockUnixLock(OsFile *id, int locktype) {
unixFile *pFile = (unixFile*)id;
- // if we already have a lock, it is exclusive.
- // Just adjust level and punt on outta here.
+ /* if we already have a lock, it is exclusive.
+ ** Just adjust level and punt on outta here. */
if (pFile->locktype > NO_LOCK) {
pFile->locktype = locktype;
return SQLITE_OK;
}
- // grab an exclusive lock
+ /* grab an exclusive lock */
int rc = flock(pFile->h, LOCK_EX | LOCK_NB);
if (rc) {
- // didn't get, must be busy
+ /* didn't get, must be busy */
return SQLITE_BUSY;
} else {
- // got it, set the type and return ok
+ /* got it, set the type and return ok */
pFile->locktype = locktype;
return SQLITE_OK;
}
assert( locktype<=SHARED_LOCK );
- // no-op if possible
+ /* no-op if possible */
if( pFile->locktype==locktype ){
return SQLITE_OK;
}
- // shared can just be set because we always have an exclusive
+ /* shared can just be set because we always have an exclusive */
if (locktype==SHARED_LOCK) {
pFile->locktype = locktype;
return SQLITE_OK;
}
- // no, really, unlock.
+ /* no, really, unlock. */
int rc = flock(pFile->h, LOCK_UN);
if (rc)
return SQLITE_IOERR_UNLOCK;
(dotlockLockingContext *) pFile->lockingContext;
if (pFile->locktype == RESERVED_LOCK) {
- return 1; // already have a reserved lock
+ return 1; /* already have a reserved lock */
} else {
struct stat statBuf;
if (lstat(context->lockPath,&statBuf) == 0)
- // file exists, someone else has the lock
+ /* file exists, someone else has the lock */
return 1;
else
- // file does not exist, we could have it if we want it
+ /* file does not exist, we could have it if we want it */
return 0;
}
}
dotlockLockingContext *context =
(dotlockLockingContext *) pFile->lockingContext;
- // if we already have a lock, it is exclusive.
- // Just adjust level and punt on outta here.
+ /* if we already have a lock, it is exclusive.
+ ** Just adjust level and punt on outta here. */
if (pFile->locktype > NO_LOCK) {
pFile->locktype = locktype;
return SQLITE_OK;
}
- // check to see if lock file already exists
+ /* check to see if lock file already exists */
struct stat statBuf;
if (lstat(context->lockPath,&statBuf) == 0){
- return SQLITE_BUSY; // it does, busy
+ return SQLITE_BUSY; /* it does, busy */
}
- // grab an exclusive lock
+ /* grab an exclusive lock */
int fd = open(context->lockPath,O_RDONLY|O_CREAT|O_EXCL,0600);
if (fd < 0) {
- // failed to open/create the file, someone else may have stolen the lock
+ /* failed to open/create the file, someone else may have stolen the lock */
return SQLITE_BUSY;
}
close(fd);
- // got it, set the type and return ok
+ /* got it, set the type and return ok */
pFile->locktype = locktype;
return SQLITE_OK;
}
assert( locktype<=SHARED_LOCK );
- // no-op if possible
+ /* no-op if possible */
if( pFile->locktype==locktype ){
return SQLITE_OK;
}
- // shared can just be set because we always have an exclusive
+ /* shared can just be set because we always have an exclusive */
if (locktype==SHARED_LOCK) {
pFile->locktype = locktype;
return SQLITE_OK;
}
- // no, really, unlock.
+ /* no, really, unlock. */
unlink(context->lockPath);
pFile->locktype = NO_LOCK;
return SQLITE_OK;
return SQLITE_NOMEM;
}
} else {
- // pLock and pOpen are only used for posix advisory locking
+ /* pLock and pOpen are only used for posix advisory locking */
f.pLock = NULL;
f.pOpen = NULL;
}