Skip to content

Commit ab5e5a4

Browse files
authored
Merge two SYSCALLS_REQUIRE_FILESYSTEM blocks. NFC (#21650)
1 parent ec26789 commit ab5e5a4

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/library_syscall.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,15 @@ var SyscallsLibrary = {
7575
var buffer = HEAPU8.slice(addr, addr + len);
7676
FS.msync(stream, buffer, offset, len, flags);
7777
},
78+
// Just like `FS.getStream` but will throw EBADF if stream is undefined.
79+
getStreamFromFD(fd) {
80+
var stream = FS.getStreamChecked(fd);
81+
#if SYSCALL_DEBUG
82+
dbg(` (stream: "${stream.path}")`);
7883
#endif
84+
return stream;
85+
},
86+
#endif // SYSCALLS_REQUIRE_FILESYSTEM
7987

8088
// arguments handling
8189

@@ -117,16 +125,6 @@ var SyscallsLibrary = {
117125
#endif
118126
return ret;
119127
},
120-
#if SYSCALLS_REQUIRE_FILESYSTEM
121-
// Just like `FS.getStream` but will throw EBADF if stream is undefined.
122-
getStreamFromFD(fd) {
123-
var stream = FS.getStreamChecked(fd);
124-
#if SYSCALL_DEBUG
125-
dbg(` (stream: "${stream.path}")`);
126-
#endif
127-
return stream;
128-
},
129-
#endif // SYSCALLS_REQUIRE_FILESYSTEM
130128
},
131129
132130
_mmap_js__i53abi: true,

0 commit comments

Comments
 (0)