aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-04-07 00:35:20 +0000
committerdrh <drh@noemail.net>2009-04-07 00:35:20 +0000
commit577d674f1a0ae6dd0f7272392caa107b492bac9d (patch)
tree809f6ea9d0e9977a04c1dc26b9dc0a0d78240d83 /src/os_unix.c
parentef165cedeb1cbcb5bbb4eb5710e13be22c3a29ae (diff)
downloadsqlite-577d674f1a0ae6dd0f7272392caa107b492bac9d.tar.gz
sqlite-577d674f1a0ae6dd0f7272392caa107b492bac9d.zip
It is OK for a unix file descriptor to be zero. It just can't be negative.
Adjust an assert accordingly. Ticket #3781. (CVS 6457) FossilOrigin-Name: 47aa7eb0e047e30bbf09cb08c1e48c61f8d9861c
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 719f16c87..75f595326 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -43,7 +43,7 @@
** * Definitions of sqlite3_vfs objects for all locking methods
** plus implementations of sqlite3_os_init() and sqlite3_os_end().
**
-** $Id: os_unix.c,v 1.248 2009/03/30 07:39:35 danielk1977 Exp $
+** $Id: os_unix.c,v 1.249 2009/04/07 00:35:20 drh Exp $
*/
#include "sqliteInt.h"
#if SQLITE_OS_UNIX /* This file is used on unix only */
@@ -3613,7 +3613,7 @@ static int unixOpen(
int flags, /* Input flags to control the opening */
int *pOutFlags /* Output flags returned to SQLite core */
){
- int fd = 0; /* File descriptor returned by open() */
+ int fd = -1; /* File descriptor returned by open() */
int dirfd = -1; /* Directory file descriptor */
int openFlags = 0; /* Flags to pass to open() */
int eType = flags&0xFFFFFF00; /* Type of file to open */
@@ -3716,7 +3716,7 @@ static int unixOpen(
}
#endif
- assert(fd!=0);
+ assert( fd>=0 );
if( isOpenDirectory ){
rc = openDirectory(zPath, &dirfd);
if( rc!=SQLITE_OK ){