Skip to content

Trying to create a directory in a file should return ENOTDIR not EPERM #23025

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 12 commits into from
Dec 2, 2024

Conversation

hoodmane
Copy link
Collaborator

In linux, mkdir("some_file/dir") returns ENOTDIR but Emscripten returns EPERM. This fixes it.

{
int target_fd = mkdir("file/blah", 0777);
printf("target_fd: %d, errno: %d %s\n", target_fd, errno, strerror(errno));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

2-space indentation.

@sbc100 sbc100 enabled auto-merge (squash) November 27, 2024 23:34
auto-merge was automatically disabled November 28, 2024 12:01

Head branch was pushed to by a user without write access

@hoodmane
Copy link
Collaborator Author

@sbc100 looks like test_nodejs_sockets_echo_subprotocol failed with Exception: [Websockify failed to start up in a timely manner] twice in a row...

@hoodmane
Copy link
Collaborator Author

test_nodejs_sockets_echo_subprotocol failed again. It works fine if I run it locally.

@hoodmane
Copy link
Collaborator Author

hoodmane commented Nov 28, 2024

It's also failing on #23017 and #22925.

@sbc100
Copy link
Collaborator

sbc100 commented Dec 2, 2024

It's also failing on #23017 and #22925.

yes it seems to be very flaky recently. I'm not sure why

@sbc100 sbc100 merged commit e42ca23 into emscripten-core:main Dec 2, 2024
26 of 28 checks passed
@@ -5832,6 +5832,10 @@ def test_fs_write(self):
def test_fs_emptyPath(self):
self.do_run_in_out_file_test('fs/test_emptyPath.c')

@also_with_noderawfs
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I forget to say we should me marking these as @Crossplatform so that they run on windows.

@hoodmane hoodmane deleted the enotdir branch December 9, 2024 15:50
hedwigz pushed a commit to hedwigz/emscripten that referenced this pull request Dec 18, 2024
emscripten-core#23025)

In linux, `mkdir("some_file/dir")` returns `ENOTDIR` but Emscripten
returns `EPERM`. This fixes it.
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