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

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
This commit is contained in:
drh
2009-04-07 00:35:20 +00:00
parent ef165cedeb
commit 577d674f1a
3 changed files with 11 additions and 11 deletions

View File

@@ -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 ){