Index: third_party/sqlite/src/src/test_demovfs.c |
diff --git a/third_party/sqlite/src/src/test_demovfs.c b/third_party/sqlite/src/src/test_demovfs.c |
index e56e8065cfbcd3cb73cfbf5d3535265b130998e8..c63b0a8b7a19bc398e1edb5d523757f2a0973e88 100644 |
--- a/third_party/sqlite/src/src/test_demovfs.c |
+++ b/third_party/sqlite/src/src/test_demovfs.c |
@@ -10,14 +10,12 @@ |
** |
************************************************************************* |
** |
-** An example of a simple VFS implementation that omits complex features |
-** often not required or not possible on embedded platforms. Also includes |
-** code to buffer writes to the journal file, which can be a significant |
-** performance improvement on some embedded platforms. |
+** This file implements an example of a simple VFS implementation that |
+** omits complex features often not required or not possible on embedded |
+** platforms. Code is included to buffer writes to the journal file, |
+** which can be a significant performance improvement on some embedded |
+** platforms. |
** |
-*/ |
- |
-/* |
** OVERVIEW |
** |
** The code in this file implements a minimal SQLite VFS that can be |
@@ -128,6 +126,7 @@ |
#include <unistd.h> |
#include <time.h> |
#include <errno.h> |
+#include <fcntl.h> |
/* |
** Size of the write buffer used by journal files in bytes. |
@@ -537,7 +536,7 @@ static int demoFullPathname( |
if( zPath[0]=='/' ){ |
zDir[0] = '\0'; |
}else{ |
- getcwd(zDir, sizeof(zDir)); |
+ if( getcwd(zDir, sizeof(zDir))==0 ) return SQLITE_IOERR; |
} |
zDir[MAXPATHNAME] = '\0'; |