diff options
author | drh <drh@noemail.net> | 2010-12-21 00:16:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-12-21 00:16:40 +0000 |
commit | 29ecd8a0779769dab9e1034e50b6527669a60aaf (patch) | |
tree | b0e463c40410551aacf5a0845a622bfaeae89fda /src/os_unix.c | |
parent | 08bd9f83ceb589a81eebe21d27e52eb1b593f438 (diff) | |
download | sqlite-29ecd8a0779769dab9e1034e50b6527669a60aaf.tar.gz sqlite-29ecd8a0779769dab9e1034e50b6527669a60aaf.zip |
Rearrange a variable declaration in the proxy locking code to avoid a harmless
compiler warning on recent MacOS versions.
FossilOrigin-Name: 39bbd35599e735b32f7ed18143073165b805dd98
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 72ac4c804..ba699632d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5403,18 +5403,19 @@ extern int gethostuuid(uuid_t id, const struct timespec *wait); ** bytes of writable memory. */ static int proxyGetHostID(unsigned char *pHostID, int *pError){ - struct timespec timeout = {1, 0}; /* 1 sec timeout */ - assert(PROXY_HOSTIDLEN == sizeof(uuid_t)); memset(pHostID, 0, PROXY_HOSTIDLEN); #if defined(__MAX_OS_X_VERSION_MIN_REQUIRED)\ && __MAC_OS_X_VERSION_MIN_REQUIRED<1050 - if( gethostuuid(pHostID, &timeout) ){ - int err = errno; - if( pError ){ - *pError = err; + { + static const struct timespec timeout = {1, 0}; /* 1 sec timeout */ + if( gethostuuid(pHostID, &timeout) ){ + int err = errno; + if( pError ){ + *pError = err; + } + return SQLITE_IOERR; } - return SQLITE_IOERR; } #endif #ifdef SQLITE_TEST |