1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix compiler warnings in the proxy locking code.

FossilOrigin-Name: 26c7689cfedf03e65bcd51df68d128101ed2c1ec
This commit is contained in:
drh
2010-07-02 17:10:40 +00:00
parent 56c77ef853
commit 0ab216a6b4
3 changed files with 13 additions and 19 deletions

View File

@@ -5067,7 +5067,7 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){
/* transform the db path to a unique cache name */
dbLen = (int)strlen(dbPath);
for( i=0; i<dbLen && (i+len+7)<maxLen; i++){
for( i=0; i<dbLen && (i+len+7)<(int)maxLen; i++){
char c = dbPath[i];
lPath[i+len] = (c=='/')?'_':c;
}
@@ -5208,6 +5208,9 @@ int sqlite3_hostid_num = 0;
#define PROXY_HOSTIDLEN 16 /* conch file host id length */
/* Not always defined in the headers as it ought to be */
extern int gethostuuid(uuid_t id, const struct timespec *wait);
/* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN
** bytes of writable memory.
*/
@@ -5257,6 +5260,7 @@ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){
char errmsg[64] = "";
int fd = -1;
int rc = -1;
UNUSED_PARAMETER(myHostID);
/* create a new path by replace the trailing '-conch' with '-break' */
pathLen = strlcpy(tPath, cPath, MAXPATHLEN);
@@ -5277,7 +5281,7 @@ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){
sprintf(errmsg, "create failed (%d)", errno);
goto end_breaklock;
}
if( pwrite(fd, buf, readLen, 0) != readLen ){
if( pwrite(fd, buf, readLen, 0) != (ssize_t)readLen ){
sprintf(errmsg, "write failed (%d)", errno);
goto end_breaklock;
}