aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/misc/fileio.c')
-rw-r--r--ext/misc/fileio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/misc/fileio.c b/ext/misc/fileio.c
index 7bb8c5efb..8f0fe3084 100644
--- a/ext/misc/fileio.c
+++ b/ext/misc/fileio.c
@@ -293,15 +293,15 @@ static int fileLinkStat(
** Argument zFile is the name of a file that will be created and/or written
** by SQL function writefile(). This function ensures that the directory
** zFile will be written to exists, creating it if required. The permissions
-** for any path components created by this function are set to (mode&0777).
+** for any path components created by this function are set in accordance
+** with the current umask.
**
** If an OOM condition is encountered, SQLITE_NOMEM is returned. Otherwise,
** SQLITE_OK is returned if the directory is successfully created, or
** SQLITE_ERROR otherwise.
*/
static int makeDirectory(
- const char *zFile,
- mode_t mode
+ const char *zFile
){
char *zCopy = sqlite3_mprintf("%s", zFile);
int rc = SQLITE_OK;
@@ -322,7 +322,7 @@ static int makeDirectory(
rc2 = fileStat(zCopy, &sStat);
if( rc2!=0 ){
- if( mkdir(zCopy, mode & 0777) ) rc = SQLITE_ERROR;
+ if( mkdir(zCopy, 0777) ) rc = SQLITE_ERROR;
}else{
if( !S_ISDIR(sStat.st_mode) ) rc = SQLITE_ERROR;
}
@@ -480,7 +480,7 @@ static void writefileFunc(
res = writeFile(context, zFile, argv[1], mode, mtime);
if( res==1 && errno==ENOENT ){
- if( makeDirectory(zFile, mode)==SQLITE_OK ){
+ if( makeDirectory(zFile)==SQLITE_OK ){
res = writeFile(context, zFile, argv[1], mode, mtime);
}
}