/ Check-in [eafd8aa1]
Login

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

Overview
Comment:Fix compiler warnings. When forcing the delete of a WAL file, do not fail if the WAL files does not exist. All "veryquick.tcl" tests are now passing on Linux under the standard compile-time options.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1:eafd8aa1862fb4bbe0d2441cbd110aba1abc772c
User & Date: drh 2014-05-09 13:27:38
Context
2014-05-09
14:56
Fix a misplaced #endif and a C99-ism in the unix VFS. check-in: c8d384d1 user: drh tags: apple-osx
13:27
Fix compiler warnings. When forcing the delete of a WAL file, do not fail if the WAL files does not exist. All "veryquick.tcl" tests are now passing on Linux under the standard compile-time options. check-in: eafd8aa1 user: drh tags: apple-osx
12:18
Fix an incorrect check for API misuse. check-in: 856400dc user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  7248   7248         pPager->pWal = 0;
  7249   7249         pagerFixMaplimit(pPager);
  7250   7250   
  7251   7251         /* Ensure that the WAL file is deleted even if the PERSIST_WAL
  7252   7252         ** hint is enabled. */
  7253   7253         if( rc==SQLITE_OK ){
  7254   7254           rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0);
         7255  +        if( rc==SQLITE_IOERR_DELETE_NOENT ) rc = SQLITE_OK;
  7255   7256         }
  7256   7257       }
  7257   7258     }
  7258   7259     return rc;
  7259   7260   }
  7260   7261   
  7261   7262   #endif /* !SQLITE_OMIT_WAL */

Changes to src/test1.c.

  5330   5330    */
  5331   5331   static int path_is_local(
  5332   5332     ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
  5333   5333     Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
  5334   5334     int objc,              /* Number of arguments */
  5335   5335     Tcl_Obj *CONST objv[]  /* Command arguments */
  5336   5336   ){
         5337  +#ifdef __APPLE__
  5337   5338     const char *zPath;
  5338   5339     int nPath;
         5340  +  struct statfs fsInfo;
  5339   5341     
  5340   5342     if( objc!=2 ){
  5341   5343       Tcl_AppendResult(interp, "wrong # args: should be \"",
  5342   5344                        Tcl_GetStringFromObj(objv[0], 0), " PATH", 0);
  5343   5345       return TCL_ERROR;
  5344   5346     }
  5345   5347     zPath = Tcl_GetStringFromObj(objv[1], &nPath);
  5346         -  
  5347         -#ifdef __APPLE__
  5348         -  {
  5349         -    struct statfs fsInfo;
  5350         -    if( statfs(zPath, &fsInfo) == -1 ){
  5351         -      int err = errno;
  5352         -      Tcl_AppendResult(interp, "Error calling statfs on path",
  5353         -                       Tcl_NewIntObj(err), 0);
  5354         -      return TCL_ERROR;
  5355         -    }
  5356         -    if( fsInfo.f_flags&MNT_LOCAL ){
  5357         -      Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); 
  5358         -    } else {
  5359         -      Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); 
  5360         -    }
         5348  +  if( statfs(zPath, &fsInfo) == -1 ){
         5349  +    int err = errno;
         5350  +    Tcl_AppendResult(interp, "Error calling statfs on path",
         5351  +                     Tcl_NewIntObj(err), 0);
         5352  +    return TCL_ERROR;
         5353  +  }
         5354  +  if( fsInfo.f_flags&MNT_LOCAL ){
         5355  +    Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); 
         5356  +  } else {
         5357  +    Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); 
  5361   5358     }
  5362   5359   #else
  5363   5360     Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); 
  5364   5361   #endif
  5365   5362     
  5366   5363     return TCL_OK;  
  5367   5364   }
................................................................................
  5371   5368    */
  5372   5369   static int path_is_dos(
  5373   5370     ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
  5374   5371     Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
  5375   5372     int objc,              /* Number of arguments */
  5376   5373     Tcl_Obj *CONST objv[]  /* Command arguments */
  5377   5374   ){
         5375  +#ifdef __APPLE__
  5378   5376     const char *zPath;
  5379   5377     int nPath;
         5378  +  struct statfs fsInfo;
  5380   5379     
  5381   5380     if( objc!=2 ){
  5382   5381       Tcl_AppendResult(interp, "wrong # args: should be \"",
  5383   5382                        Tcl_GetStringFromObj(objv[0], 0), " PATH", 0);
  5384   5383       return TCL_ERROR;
  5385   5384     }
  5386   5385     zPath = Tcl_GetStringFromObj(objv[1], &nPath);
  5387         -  
  5388         -#ifdef __APPLE__
  5389         -  {
  5390         -    struct statfs fsInfo;
  5391         -    if( statfs(zPath, &fsInfo) == -1 ){
  5392         -      int err = errno;
  5393         -      Tcl_AppendResult(interp, "Error calling statfs on path",
  5394         -                       Tcl_NewIntObj(err), 0);
  5395         -      return TCL_ERROR;
  5396         -    }
  5397         -    if (0 == strncmp("msdos", fsInfo.f_fstypename, 5)) {
  5398         -      Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); 
  5399         -    } else if (0 == strncmp("exfat", fsInfo.f_fstypename, 5)) {
  5400         -      Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); 
  5401         -    } else {
  5402         -      Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); 
  5403         -    }
         5386  +  if( statfs(zPath, &fsInfo) == -1 ){
         5387  +    int err = errno;
         5388  +    Tcl_AppendResult(interp, "Error calling statfs on path",
         5389  +                     Tcl_NewIntObj(err), 0);
         5390  +    return TCL_ERROR;
         5391  +  }
         5392  +  if (0 == strncmp("msdos", fsInfo.f_fstypename, 5)) {
         5393  +    Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); 
         5394  +  } else if (0 == strncmp("exfat", fsInfo.f_fstypename, 5)) {
         5395  +    Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); 
         5396  +  } else {
         5397  +    Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); 
  5404   5398     }
  5405   5399   #else
  5406   5400     Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); 
  5407   5401   #endif
  5408   5402     
  5409   5403     return TCL_OK;  
  5410   5404   }