Skip to content

Commit 4e8f389

Browse files
JanWielemakerclaude
andcommitted
FIXED: set_stream/2 close_on_exec silently succeeded on unsupported platforms
setCloseOnExec() returned -1 where close-on-exec is unavailable, which set_stream/2 treated as success. Raise a not_implemented(feature, close_on_exec) exception instead and return bool. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 495b7a3 commit 4e8f389

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/os/pl-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,7 @@ PRED_IMPL("noprotocol", 0, noprotocol, 0)
21042104
* STREAM ATTRIBUTES *
21052105
*******************************/
21062106

2107-
static int
2107+
static bool
21082108
setCloseOnExec(IOSTREAM *s, bool val)
21092109
{ int fd;
21102110

@@ -2130,7 +2130,7 @@ setCloseOnExec(IOSTREAM *s, bool val)
21302130
return false;
21312131
}
21322132
#else
2133-
return -1;
2133+
return PL_error(NULL, 0, NULL, ERR_NOT_IMPLEMENTED, "close_on_exec");
21342134
#endif
21352135

21362136
return true;

0 commit comments

Comments
 (0)