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

Fix compiler warnings discovered while building SQLite on [http://www.devio.us/].

FossilOrigin-Name: 5602ec95aa2a74d0624bb6c7d53e7a0d35536253
This commit is contained in:
dan
2010-11-29 17:55:18 +00:00
parent 5957b1bc73
commit 0cb3a1eca4
4 changed files with 50 additions and 44 deletions

View File

@@ -5457,27 +5457,27 @@ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){
pathLen = strlcpy(tPath, cPath, MAXPATHLEN);
if( pathLen>MAXPATHLEN || pathLen<6 ||
(strlcpy(&tPath[pathLen-5], "break", 6) != 5) ){
sprintf(errmsg, "path error (len %d)", (int)pathLen);
sqlite3_snprintf(sizeof(errmsg),errmsg,"path error (len %d)",(int)pathLen);
goto end_breaklock;
}
/* read the conch content */
readLen = pread(conchFile->h, buf, PROXY_MAXCONCHLEN, 0);
if( readLen<PROXY_PATHINDEX ){
sprintf(errmsg, "read error (len %d)", (int)readLen);
sqlite3_snprintf(sizeof(errmsg),errmsg,"read error (len %d)",(int)readLen);
goto end_breaklock;
}
/* write it out to the temporary break file */
fd = open(tPath, (O_RDWR|O_CREAT|O_EXCL), SQLITE_DEFAULT_FILE_PERMISSIONS);
if( fd<0 ){
sprintf(errmsg, "create failed (%d)", errno);
sqlite3_snprintf(sizeof(errmsg), errmsg, "create failed (%d)", errno);
goto end_breaklock;
}
if( pwrite(fd, buf, readLen, 0) != (ssize_t)readLen ){
sprintf(errmsg, "write failed (%d)", errno);
sqlite3_snprintf(sizeof(errmsg), errmsg, "write failed (%d)", errno);
goto end_breaklock;
}
if( rename(tPath, cPath) ){
sprintf(errmsg, "rename failed (%d)", errno);
sqlite3_snprintf(sizeof(errmsg), errmsg, "rename failed (%d)", errno);
goto end_breaklock;
}
rc = 0;