/ Check-in [8aaa7700]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Hide (for non-debugging builds) and remove DELETEONCLOSE files on OS/2, following the Windows example. Ticket #3328. (CVS 5592)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8aaa77000fb86fe512405a0ad40cb08678a12198
User & Date: pweilbacher 2008-08-22 13:47:57
Context
2008-08-22
13:57
fix some tests to take the right branch on OS/2 (hope I got the Tcl syntax right) (CVS 5593) check-in: 10e62d47 user: pweilbacher tags: trunk
13:47
Hide (for non-debugging builds) and remove DELETEONCLOSE files on OS/2, following the Windows example. Ticket #3328. (CVS 5592) check-in: 8aaa7700 user: pweilbacher tags: trunk
12:57
Fix nuisance compiler warnings. Ticket #3309. (CVS 5591) check-in: 2a365e29 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_os2.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains code that is specific to OS/2.
    14     14   **
    15         -** $Id: os_os2.c,v 1.55 2008/07/29 18:49:29 pweilbacher Exp $
           15  +** $Id: os_os2.c,v 1.56 2008/08/22 13:47:57 pweilbacher Exp $
    16     16   */
    17     17   
    18     18   #include "sqliteInt.h"
    19     19   
    20     20   #if SQLITE_OS_OS2
    21     21   
    22     22   /*
................................................................................
   742    742     sqlite3_vfs *pVfs,            /* Not used */
   743    743     const char *zName,            /* Name of the file */
   744    744     sqlite3_file *id,             /* Write the SQLite file handle here */
   745    745     int flags,                    /* Open mode flags */
   746    746     int *pOutFlags                /* Status return flags */
   747    747   ){
   748    748     HFILE h;
   749         -  ULONG ulFileAttribute = 0;
          749  +  ULONG ulFileAttribute = FILE_NORMAL;
   750    750     ULONG ulOpenFlags = 0;
   751    751     ULONG ulOpenMode = 0;
   752    752     os2File *pFile = (os2File*)id;
   753    753     APIRET rc = NO_ERROR;
   754    754     ULONG ulAction;
   755    755     char *zNameCp;
   756    756     char zTmpname[CCHMAXPATH+1];    /* Buffer to hold name of temp file */
................................................................................
   767    767     }
   768    768   
   769    769   
   770    770     memset( pFile, 0, sizeof(*pFile) );
   771    771   
   772    772     OSTRACE2( "OPEN want %d\n", flags );
   773    773   
   774         -  /*ulOpenMode = flags & SQLITE_OPEN_READWRITE ? OPEN_ACCESS_READWRITE : OPEN_ACCESS_READONLY;*/
   775    774     if( flags & SQLITE_OPEN_READWRITE ){
   776    775       ulOpenMode |= OPEN_ACCESS_READWRITE;
   777    776       OSTRACE1( "OPEN read/write\n" );
   778    777     }else{
   779    778       ulOpenMode |= OPEN_ACCESS_READONLY;
   780    779       OSTRACE1( "OPEN read only\n" );
   781    780     }
   782    781   
   783         -  /*ulOpenFlags = flags & SQLITE_OPEN_CREATE ? OPEN_ACTION_CREATE_IF_NEW : OPEN_ACTION_FAIL_IF_NEW;*/
   784    782     if( flags & SQLITE_OPEN_CREATE ){
   785    783       ulOpenFlags |= OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
   786    784       OSTRACE1( "OPEN open new/create\n" );
   787    785     }else{
   788    786       ulOpenFlags |= OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
   789    787       OSTRACE1( "OPEN open existing\n" );
   790    788     }
   791    789   
   792         -  /*ulOpenMode |= flags & SQLITE_OPEN_MAIN_DB ? OPEN_SHARE_DENYNONE : OPEN_SHARE_DENYWRITE;*/
   793    790     if( flags & SQLITE_OPEN_MAIN_DB ){
   794    791       ulOpenMode |= OPEN_SHARE_DENYNONE;
   795    792       OSTRACE1( "OPEN share read/write\n" );
   796    793     }else{
   797    794       ulOpenMode |= OPEN_SHARE_DENYWRITE;
   798    795       OSTRACE1( "OPEN share read only\n" );
   799    796     }
   800    797   
   801         -  if( flags & (SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_TEMP_JOURNAL
   802         -               | SQLITE_OPEN_SUBJOURNAL) ){
          798  +  if( flags & SQLITE_OPEN_DELETEONCLOSE ){
   803    799       char pathUtf8[CCHMAXPATH];
   804    800   #ifdef NDEBUG /* when debugging we want to make sure it is deleted */
   805    801       ulFileAttribute = FILE_HIDDEN;
   806    802   #endif
   807         -    ulFileAttribute = FILE_NORMAL;
   808    803       os2FullPathname( pVfs, zName, CCHMAXPATH, pathUtf8 );
   809    804       pFile->pathToDel = convertUtf8PathToCp( pathUtf8 );
   810    805       OSTRACE1( "OPEN hidden/delete on close file attributes\n" );
   811    806     }else{
   812         -    ulFileAttribute = FILE_ARCHIVED | FILE_NORMAL;
   813    807       pFile->pathToDel = NULL;
   814    808       OSTRACE1( "OPEN normal file attribute\n" );
   815    809     }
   816    810   
   817    811     /* always open in random access mode for possibly better speed */
   818    812     ulOpenMode |= OPEN_FLAGS_RANDOM;
   819    813     ulOpenMode |= OPEN_FLAGS_FAIL_ON_ERROR;