Skip to content

Fix utime(s) with FILESYSTEM=0 #16070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 20, 2022
Merged

Fix utime(s) with FILESYSTEM=0 #16070

merged 2 commits into from
Jan 20, 2022

Conversation

kripken
Copy link
Member

@kripken kripken commented Jan 19, 2022

This fixes compilation of Sqlite in the benchmark suite. Not sure why this
became an issue at some point when it wasn't in the past - might have been
the musl upgrade perhaps?

@kripken kripken requested a review from sbc100 January 19, 2022 21:09
src/library.js Outdated
@@ -85,8 +86,14 @@ LibraryManager.library = {
return -1;
}
},
#else
$setFileTime: function(path, time) {
// No filesystem support; no-op.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps returning setErrNo(ENOENT); return -1 would make more sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but it seems better to not error given that there are no files, really, rather than always error. That is, the problem cannot be noticed - this is "write only memory" as the joke goes. So all it could do is confuse a program that cares about the return value.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I disagree... if the file doesn't exist we should return an error. I can't imagine a program that break because isn't set utime on a non-existent file. stat and open will both fail.. so why allow utimes to succeed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, fair enough. While there is no way to observe if the file exists or not, however, since file support is disabled, but I guess only the standard streams exist... which I suppose one cannot utime?

@kripken kripken enabled auto-merge (squash) January 20, 2022 17:43
@kripken kripken merged commit 5217a0e into main Jan 20, 2022
@kripken kripken deleted the fixutimes branch January 20, 2022 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants