Skip to content

Commit 2c41571

Browse files
committed
Fix directory fds for nameless file patch
1 parent 7f4533e commit 2c41571

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/library_nodefs.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,13 @@ addToLibrary({
248248
open(stream) {
249249
var path = NODEFS.realPath(stream.node);
250250
NODEFS.tryFSOperation(() => {
251-
if (FS.isFile(stream.node.mode)) {
252-
stream.shared.refcount = 1;
253-
stream.nfd = fs.openSync(path, NODEFS.flagsForNode(stream.flags));
254-
}
251+
stream.shared.refcount = 1;
252+
stream.nfd = fs.openSync(path, NODEFS.flagsForNode(stream.flags));
255253
});
256254
},
257255
close(stream) {
258256
NODEFS.tryFSOperation(() => {
259-
if (FS.isFile(stream.node.mode) && stream.nfd && --stream.shared.refcount === 0) {
257+
if (stream.nfd && --stream.shared.refcount === 0) {
260258
fs.closeSync(stream.nfd);
261259
}
262260
});

0 commit comments

Comments
 (0)