diff --git a/fs/tty.c b/fs/tty.c index 9cd3a08c..0d6cf4f6 100644 --- a/fs/tty.c +++ b/fs/tty.c @@ -672,7 +672,7 @@ static int tiocgpgrp(struct tty *tty, pid_t_ *fg_group) { lock(&slave->lock); } - if (tty == slave && !tty_is_current(slave) || slave->fg_group == 0) { + if (tty == slave && (!tty_is_current(slave) || slave->fg_group == 0)) { err = _ENOTTY; goto error_no_ctrl_tty; }