- ioctl(1, TIOCGWINSZ, (char *)&win);
- if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0)
+ if (ioctl(1, TIOCGWINSZ, (char *)&win) < 0)
+ {
+ _error->Errno("ioctl", _("ioctl(TIOCGWINSZ) failed"));
+ } else if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0)