Skip to content

Commit 5217a0e

Browse files
authored
Fix utime(s) with FILESYSTEM=0 (#16070)
This fixes compilation of Sqlite in the benchmark suite
1 parent ed4a2f4 commit 5217a0e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/library.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ LibraryManager.library = {
7373
// utime.h
7474
// ==========================================================================
7575

76-
$setFileTime__deps: ['$setErrNo'],
76+
#if FILESYSTEM
77+
$setFileTime__deps: ['$FS', '$setErrNo'],
7778
$setFileTime: function(path, time) {
7879
path = UTF8ToString(path);
7980
try {
@@ -85,8 +86,17 @@ LibraryManager.library = {
8586
return -1;
8687
}
8788
},
89+
#else
90+
$setFileTime__deps: ['$setErrNo'],
91+
$setFileTime: function(path, time) {
92+
// No filesystem support; return an error as if the file does not exist
93+
// (which it almost certainly does not, except for standard streams).
94+
setErrNo({{{ cDefine('ENOENT') }}});
95+
return -1;
96+
},
97+
#endif
8898

89-
utime__deps: ['$FS', '$setFileTime'],
99+
utime__deps: ['$setFileTime'],
90100
utime__proxy: 'sync',
91101
utime__sig: 'iii',
92102
utime: function(path, times) {
@@ -103,7 +113,7 @@ LibraryManager.library = {
103113
return setFileTime(path, time);
104114
},
105115

106-
utimes__deps: ['$FS', '$setFileTime'],
116+
utimes__deps: ['$setFileTime'],
107117
utimes__proxy: 'sync',
108118
utimes__sig: 'iii',
109119
utimes: function(path, times) {

0 commit comments

Comments
 (0)