Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sys/compat/linux/common/linux_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,19 @@ linux_open_ctty(struct lwp *l, int flags, int fd)
* terminal yet, and the O_NOCTTY flag is not set, try to make
* this the controlling terminal.
*/
if (!(flags & O_NOCTTY) && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) {
file_t *fp;
if (!(flags & O_NOCTTY) && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) {
file_t *fp;

fp = fd_getfile(fd);

/* ignore any error, just give it a try */
if (fp != NULL) {
/* ignore any error, just give it a try */
if (fp != NULL) {
if (fp->f_type == DTYPE_VNODE) {
(fp->f_ops->fo_ioctl) (fp, TIOCSCTTY, NULL);
}
fd_putfile(fd);
}
}
}
}

/*
Expand Down