/ Check-in [33ba1f4c]
Login

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

Overview
Comment:Slight modifications to path name translation handling for Cygwin.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 33ba1f4c5dc2ef8292adf17a32ade0cde0887d88
User & Date: mistachkin 2013-07-31 22:39:26
Context
2013-07-31
23:28
Limit the number of memset() calls used when determining a temporary file name on Windows. Also, fix a harmless compiler warning. check-in: 136fc293 user: mistachkin tags: trunk
22:39
Slight modifications to path name translation handling for Cygwin. check-in: 33ba1f4c user: mistachkin tags: trunk
22:27
Use a new error code to represent a failure to get the configured temporary directory on Windows. check-in: c93d891b user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

    13     13   ** This file contains code that is specific to Windows.
    14     14   */
    15     15   #include "sqliteInt.h"
    16     16   #if SQLITE_OS_WIN               /* This file is used for Windows only */
    17     17   
    18     18   #ifdef __CYGWIN__
    19     19   # include <sys/cygwin.h>
           20  +# include <errno.h>
    20     21   #endif
    21     22   
    22     23   /*
    23     24   ** Include code that is common to all os_*.c files
    24     25   */
    25     26   #include "os_common.h"
    26     27   
................................................................................
  4526   4527       /*
  4527   4528       ** NOTE: We are dealing with a relative path name and the data
  4528   4529       **       directory has been set.  Therefore, use it as the basis
  4529   4530       **       for converting the relative path name to an absolute
  4530   4531       **       one by prepending the data directory and a slash.
  4531   4532       */
  4532   4533       char zOut[SQLITE_WIN32_MAX_PATH+1];
  4533         -    memset(zOut, 0, SQLITE_WIN32_MAX_PATH+1);
  4534         -    cygwin_conv_path(CCP_POSIX_TO_WIN_A|CCP_RELATIVE, zRelative, zOut,
  4535         -                     SQLITE_WIN32_MAX_PATH+1);
         4534  +    if( cygwin_conv_path(CCP_POSIX_TO_WIN_A|CCP_RELATIVE, zRelative, zOut,
         4535  +                         SQLITE_WIN32_MAX_PATH+1)<0 ){
         4536  +      winLogError(SQLITE_CANTOPEN_FULLPATH, (DWORD)errno, "cygwin_conv_path",
         4537  +                  zRelative);
         4538  +      return SQLITE_CANTOPEN_FULLPATH;
         4539  +    }
  4536   4540       sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s\\%s",
  4537   4541                        sqlite3_data_directory, zOut);
  4538   4542     }else{
  4539         -    cygwin_conv_path(CCP_POSIX_TO_WIN_A, zRelative, zFull, nFull);
         4543  +    if( cygwin_conv_path(CCP_POSIX_TO_WIN_A, zRelative, zFull, nFull)<0 ){
         4544  +      winLogError(SQLITE_CANTOPEN_FULLPATH, (DWORD)errno, "cygwin_conv_path",
         4545  +                  zRelative);
         4546  +      return SQLITE_CANTOPEN_FULLPATH;
         4547  +    }
  4540   4548     }
  4541   4549     return SQLITE_OK;
  4542   4550   #endif
  4543   4551   
  4544   4552   #if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && !defined(__CYGWIN__)
  4545   4553     SimulateIOError( return SQLITE_ERROR );
  4546   4554     /* WinCE has no concept of a relative pathname, or so I am told. */