Messages in this thread | | | From | (really ) | Date | 24 Apr 1996 22:27:13 +0400 | Subject | Re: PTY feature? or bug? |
| |
Apparently, you forgot:
add_wait_queue(&pty->open_wait, &wait); #ifndef NO_ANK_FIX current->state = TASK_INTERRUPTIBLE; #endif retval = 0; while (1) { if (current->signal & ~current->blocked) { retval = -ERESTARTSYS; break; } /* * Block until the master is open... */ if (tty->link->count && !test_bit(TTY_OTHER_CLOSED, &tty->flags)) break; schedule(); } current->state = TASK_RUNNING; remove_wait_queue(&pty->open_wait, &wait);
I'd like to repeat my question.
Are you sure, that it should wait for master open?
All the applications, that I've seen (rlogind, telnetd, emacs, xterm), open master and only then open slave.
I'd propose return EIO (EAGAIN,....) on the attempt to open orphaned pty slave. If BSD does not make it, it is BSD's bug, I believe.
Alexey Kuznetsov.
| |