1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Change the shell to use the sqliteIsNumber() routine for determining if

values are numeric.  Modified os.c so that it should now work with DJGPP -
though I have no way of testing this. (CVS 913)

FossilOrigin-Name: 35caefe31750fd103b5f0231ad36f375771063eb
This commit is contained in:
drh
2003-04-17 02:54:13 +00:00
parent 95b5084409
commit 8396566204
4 changed files with 38 additions and 41 deletions

View File

@@ -31,8 +31,12 @@
# ifndef O_NOFOLLOW
# define O_NOFOLLOW 0
# endif
# ifndef O_BINARY
# define O_BINARY 0
# endif
#endif
#if OS_WIN
# include <winbase.h>
#endif
@@ -47,6 +51,16 @@
# include <OSUtils.h>
#endif
/*
** The DJGPP compiler environment looks mostly like Unix, but it
** lacks the fcntl() system call. So redefine fcntl() to be something
** that always succeeds. This means that locking does not occur under
** DJGPP. But its DOS - what did you expect?
*/
#ifdef __DJGPP__
# define fcntl(A,B,C) 0
#endif
/*
** Macros for performance tracing. Normally turned off
*/
@@ -311,9 +325,9 @@ int sqliteOsOpenReadWrite(
int *pReadonly
){
#if OS_UNIX
id->fd = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE, 0644);
id->fd = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, 0644);
if( id->fd<0 ){
id->fd = open(zFilename, O_RDONLY|O_LARGEFILE);
id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
if( id->fd<0 ){
return SQLITE_CANTOPEN;
}
@@ -435,7 +449,8 @@ int sqliteOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
if( access(zFilename, 0)==0 ){
return SQLITE_CANTOPEN;
}
id->fd = open(zFilename, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE, 0600);
id->fd = open(zFilename,
O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY, 0600);
if( id->fd<0 ){
return SQLITE_CANTOPEN;
}
@@ -520,7 +535,7 @@ int sqliteOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
*/
int sqliteOsOpenReadOnly(const char *zFilename, OsFile *id){
#if OS_UNIX
id->fd = open(zFilename, O_RDONLY|O_LARGEFILE);
id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
if( id->fd<0 ){
return SQLITE_CANTOPEN;
}