-C Another\sattempt\sto\sfix\swarnings\sin\sthe\srandomFunc()\sfunction.
-D 2012-02-11T19:53:24.226
+C Silence\sGCC\scompiler\swarnings\sabout\sunused\sreturn\svalue\sfrom\sfchown().
+D 2012-02-11T21:21:17.335
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 3f79a373e57c3b92dabf76f40b065e719d31ac34
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/os.h 59beba555b65a450bd1d804220532971d4299f60
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440
-F src/os_unix.c f7e7b3e4f6922e3b07250a22c81da766ac2cc8fa
+F src/os_unix.c 3dd0399fe024df37af2980c99f1a3c1d3cc6a782
F src/os_win.c 5ac061ae1326a71500cee578ed0fd9113b4f6a37
F src/pager.c 2d892f7b901a8867a33bc21742086165a3a99af8
F src/pager.h a435da8421dc7844b7f9c7f37b636c160c50208a
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P 1254dffe4071656a783cd000b1dd40c975ac18cb
-R d9fa00aa327e93350ee48bb2f6ecc475
+P 768df4e11670ac704d96e3b601d009aaa2fd793a
+R 356443deb3c82ed63a280950a7c5c72e
U drh
-Z 4e53a459dae4b9322244fc7645ecba60
+Z 590e6955e1a8261beb6491e7ffa39206
unixInodeInfo *pInode; /* Info about locks on this inode */
int h; /* The file descriptor */
unsigned char eFileLock; /* The type of lock held on this fd */
- unsigned char ctrlFlags; /* Behavioral bits. UNIXFILE_* flags */
+ unsigned short int ctrlFlags; /* Behavioral bits. UNIXFILE_* flags */
int lastErrno; /* The unix errno from last I/O error */
void *lockingContext; /* Locking style specific state */
UnixUnusedFd *pUnused; /* Pre-allocated UnixUnusedFd */
#define UNIXFILE_DELETE 0x20 /* Delete on close */
#define UNIXFILE_URI 0x40 /* Filename might have query parameters */
#define UNIXFILE_NOLOCK 0x80 /* Do no file locking */
+#define UNIXFILE_CHOWN 0x100 /* File ownership was changed */
/*
** Include code that is common to all os_*.c files
/* If this process is running as root, make sure that the SHM file
** is owned by the same user that owns the original database. Otherwise,
** the original owner will not be able to connect. If this process is
- ** not root, the following fchown() will fail, but we don't care.
+ ** not root, the following fchown() will fail, but we don't care. The
+ ** if(){..} and the UNIXFILE_CHOWN flag are purely to silence compiler
+ ** warnings.
*/
- fchown(pShmNode->h, sStat.st_uid, sStat.st_gid);
+ if( fchown(pShmNode->h, sStat.st_uid, sStat.st_gid)==0 ){
+ pDbFd->ctrlFlags |= UNIXFILE_CHOWN;
+ }
/* Check to see if another process is holding the dead-man switch.
** If not, truncate the file to zero length.
/* If this process is running as root and if creating a new rollback
** journal or WAL file, set the ownership of the journal or WAL to be
** the same as the original database. If we are not running as root,
- ** then the fchown() call will fail, but that's ok - there is nothing
- ** we can do about it so just ignore the error.
+ ** then the fchown() call will fail, but that's ok. The "if(){}" and
+ ** the setting of the UNIXFILE_CHOWN flag are purely to silence compiler
+ ** warnings from gcc.
*/
if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){
- fchown(fd, uid, gid);
+ if( fchown(fd, uid, gid)==0 ){ p->ctrlFlags |= UNIXFILE_CHOWN; }
}
}
assert( fd>=0 );