Skip to content

Commit 281f487

Browse files
committed
Fix open/4 wrong error, re issue #1045
1 parent 0ab3231 commit 281f487

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/bif_streams.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,9 @@ static bool bif_iso_open_4(query *q)
11321132
}
11331133

11341134
if (!str->fp) {
1135-
if ((errno == EACCES) || (strcmp(str->mode, "read") && (errno == EROFS)))
1135+
if ((errno == EACCES) || (strcmp(str->mode, "read")
1136+
&& ((errno == EROFS) || (errno == EISDIR))
1137+
))
11361138
return throw_error(q, p1, p1_ctx, "permission_error", "open,source_sink");
11371139
//else if ((strcmp(str->mode, "read") && (errno == EISDIR)))
11381140
// return throw_error(q, p1, p1_ctx, "permission_error", "open,isadir");

0 commit comments

Comments
 (0)