diff options
author | drh <drh@noemail.net> | 2007-09-20 10:02:54 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-09-20 10:02:54 +0000 |
commit | 777b17af7e69465ec2e748aab123993b5d7268cf (patch) | |
tree | f463599226c85391a8b949dc6893d7617a2eb4fc /src/os_unix.c | |
parent | 25c0d1a18a688a9436e500a8313fcd5c85696e59 (diff) | |
download | sqlite-777b17af7e69465ec2e748aab123993b5d7268cf.tar.gz sqlite-777b17af7e69465ec2e748aab123993b5d7268cf.zip |
Fixes for uninitialized variables. Tickets #2658 and #2659. (CVS 4437)
FossilOrigin-Name: 27fe1288336665c4d47c5d7ddcbeacc451ec4a9d
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 425bdc5f3..e95435e74 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2290,7 +2290,7 @@ static int fillInUnixFile( */ static int openDirectory(const char *zFilename, int *pFd){ int ii; - int fd; + int fd = -1; char zDirname[MAX_PATHNAME+1]; sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename); @@ -2298,7 +2298,7 @@ static int openDirectory(const char *zFilename, int *pFd){ if( ii>0 ){ zDirname[ii] = '\0'; fd = open(zDirname, O_RDONLY|O_BINARY, 0); - if( fd>0 ){ + if( fd>=0 ){ #ifdef FD_CLOEXEC fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC); #endif @@ -2306,7 +2306,7 @@ static int openDirectory(const char *zFilename, int *pFd){ } } *pFd = fd; - return (fd>0?SQLITE_OK:SQLITE_CANTOPEN); + return (fd>=0?SQLITE_OK:SQLITE_CANTOPEN); } /* |