Skip to content

Commit 42f724b

Browse files
authored
Fix for core0.test_stat_chmod_rawfs on mac. NFC (#23023)
I'm not sure how #23018 managed landed with this broken.
1 parent ca8fd33 commit 42f724b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/stat/test_chmod.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ void setup() {
3232
create_file("file", "abcdef", 0777);
3333
create_file("otherfile", "abcdef", 0777);
3434
symlink("file", "file-link");
35-
// some platforms use 777, some use 755 by default for symlinks
36-
// make sure we're using 777 for the test
37-
lchmod("file-link", 0777);
3835
mkdir("folder", 0777);
3936
}
4037

@@ -113,6 +110,10 @@ void test() {
113110
assert(s.st_ctime != lastctime);
114111

115112
#ifndef WASMFS // TODO https://github.com/emscripten-core/emscripten/issues/15948
113+
lstat("file-link", &s);
114+
int link_mode = s.st_mode;
115+
assert((link_mode & 0777) != S_IRUSR);
116+
116117
//
117118
// chmod a symlink's target
118119
//
@@ -125,7 +126,7 @@ void test() {
125126

126127
// but the link didn't
127128
lstat("file-link", &s);
128-
assert(s.st_mode == (0777 | S_IFLNK));
129+
assert(s.st_mode == link_mode);
129130

130131
//
131132
// chmod the actual symlink

0 commit comments

Comments
 (0)