6 err = ioctl (fd, TIOCNOTTY, (char *) 0);
7 + if (-1 == err && ENOTTY == errno) {
8 + /* There are no controlling terminal already */
12 - } else if (ENXIO == errno) {
13 + } else if (ENXIO == errno || EACCES == errno) {
14 /* There are no controlling terminal already */