aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-07-03 12:31:34 +0000
committerdrh <drh@noemail.net>2010-07-03 12:31:34 +0000
commitb0ab011dc51a31d6b8784e9b78a735761d75748b (patch)
treedba04ecb02eeacfe6dea2c903d4d0fb48dffb3a8 /src/os_unix.c
parent230fd98dd3f127d7d2fbb8fdd85f002a824cece0 (diff)
parent40e459e041034ad39e753aad1c1ed7c00352e41e (diff)
downloadsqlite-b0ab011dc51a31d6b8784e9b78a735761d75748b.tar.gz
sqlite-b0ab011dc51a31d6b8784e9b78a735761d75748b.zip
Cherry-pick the correct changes out of the recent "mistake" branch while
omitting the bogus changes. FossilOrigin-Name: 48bf309391c32e7860c293acd13f3dda14212d39
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 06712668b..a41b57983 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -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;
}