mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-25 19:46:21 +00:00
fcntl(..., F_SETFL, ...) return value only signals error. (#141)
The return value of `fcntl` when passed `F_SETFL` isn't guaranteed to return the flags passed in as its return value. It will be `-1` in the event of an error, but no other value is to be relied upon. Fortunately, we weren't relying upon the value apart from occasionally checking for an error. This is as it is specified in https://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.html Closes interlisp/medley#87.
This commit is contained in:
@@ -149,7 +149,7 @@ gotpty:
|
||||
#ifdef LOGINT
|
||||
LogFileFd = cons_pty; /* was kept as an fd_set, but doesn't need to be */
|
||||
flags = fcntl(cons_pty, F_GETFL, 0);
|
||||
flags = fcntl(cons_pty, F_SETFL, (flags | FASYNC | FNDELAY));
|
||||
fcntl(cons_pty, F_SETFL, (flags | FASYNC | FNDELAY));
|
||||
if (fcntl(cons_pty, F_SETOWN, getpid()) == -1) {
|
||||
#ifdef DEBUG
|
||||
perror("fcntl F_SETOWN of log PTY");
|
||||
|
||||
Reference in New Issue
Block a user