/ Check-in [02e123bb]
Login

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

Overview
Comment:Remove delOnClose flag from os2File structure, use pathToDel==NULL for the same check. (CVS 5090)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 02e123bb9b3da81bc8ee8bab7a2c54bbaadc5123
User & Date: pweilbacher 2008-05-06 21:42:10
Context
2008-05-06
22:15
The pathToDel element of the os2File structure should be in the local codepage instead of UTF-8 to make DosForceDelete() work. (CVS 5091) check-in: 76028b5e user: pweilbacher tags: trunk
21:42
Remove delOnClose flag from os2File structure, use pathToDel==NULL for the same check. (CVS 5090) check-in: 02e123bb user: pweilbacher tags: trunk
18:13
Fix a bug whereby the database file was not always being extended to its original size when rolling back an incremental-vacuum operation. (CVS 5089) check-in: 4a1ae9d0 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_os2.c.

    59     59   ** The os2File structure is subclass of sqlite3_file specific for the OS/2
    60     60   ** protability layer.
    61     61   */
    62     62   typedef struct os2File os2File;
    63     63   struct os2File {
    64     64     const sqlite3_io_methods *pMethod;  /* Always the first entry */
    65     65     HFILE h;                  /* Handle for accessing the file */
    66         -  int delOnClose;           /* True if file is to be deleted on close */
    67         -  char* pathToDel;          /* Name of file to delete on close */
           66  +  char* pathToDel;          /* Name of file to delete on close, NULL if not */
    68     67     unsigned char locktype;   /* Type of lock currently held on this file */
    69     68   };
    70     69   
    71     70   /*****************************************************************************
    72     71   ** The next group of routines implement the I/O methods specified
    73     72   ** by the sqlite3_io_methods object.
    74     73   ******************************************************************************/
................................................................................
    79     78   int os2Close( sqlite3_file *id ){
    80     79     APIRET rc = NO_ERROR;
    81     80     os2File *pFile;
    82     81     if( id && (pFile = (os2File*)id) != 0 ){
    83     82       OSTRACE2( "CLOSE %d\n", pFile->h );
    84     83       rc = DosClose( pFile->h );
    85     84       pFile->locktype = NO_LOCK;
    86         -    if( pFile->delOnClose != 0 ){
           85  +    if( pFile->pathToDel != NULL ){
    87     86         rc = DosForceDelete( (PSZ)pFile->pathToDel );
    88         -    }
    89         -    if( pFile->pathToDel ){
    90     87         free( pFile->pathToDel );
           88  +      pFile->pathToDel = NULL;
    91     89       }
    92     90       id = 0;
    93     91       OpenCounter( -1 );
    94     92     }
    95     93   
    96     94     return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
    97     95   }
................................................................................
   688    686       OSTRACE1( "OPEN share read only\n" );
   689    687     }
   690    688   
   691    689     if( flags & (SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_TEMP_JOURNAL
   692    690                  | SQLITE_OPEN_SUBJOURNAL) ){
   693    691       //ulFileAttribute = FILE_HIDDEN;  //for debugging, we want to make sure it is deleted
   694    692       ulFileAttribute = FILE_NORMAL;
   695         -    pFile->delOnClose = 1;
   696    693       pFile->pathToDel = (char*)malloc(sizeof(char) * pVfs->mxPathname);
   697    694       sqlite3OsFullPathname(pVfs, zName, pVfs->mxPathname, pFile->pathToDel);
   698    695       OSTRACE1( "OPEN hidden/delete on close file attributes\n" );
   699    696     }else{
   700    697       ulFileAttribute = FILE_ARCHIVED | FILE_NORMAL;
   701         -    pFile->delOnClose = 0;
   702    698       pFile->pathToDel = NULL;
   703    699       OSTRACE1( "OPEN normal file attribute\n" );
   704    700     }
   705    701   
   706    702     /* always open in random access mode for possibly better speed */
   707    703     ulOpenMode |= OPEN_FLAGS_RANDOM;
   708    704     ulOpenMode |= OPEN_FLAGS_FAIL_ON_ERROR;