are both specified. Make it clearer how ttyfd gets set.
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: tty.c,v 1.16 2004/10/28 00:16:37 paulus Exp $"
+#define RCSID "$Id: tty.c,v 1.17 2004/11/04 09:59:12 paulus Exp $"
#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
#include <ctype.h>
if (using_pty) {
if (!default_device) {
option_error("%s option precludes specifying device name",
if (using_pty) {
if (!default_device) {
option_error("%s option precludes specifying device name",
- notty? "notty": "pty");
+ pty_socket? "socket": notty? "notty": "pty");
exit(EXIT_OPTION_ERROR);
}
if (ptycommand != NULL && notty) {
exit(EXIT_OPTION_ERROR);
}
if (ptycommand != NULL && notty) {
+ if (using_pty || record_file != NULL)
+ ttyfd = pty_slave;
+
/* run connection script */
if ((connector && connector[0]) || initializer) {
if (real_ttyfd != -1) {
/* run connection script */
if ((connector && connector[0]) || initializer) {
if (real_ttyfd != -1) {
add_notifier(&sigreceived, stop_charshunt, 0);
close(pty_master);
pty_master = -1;
add_notifier(&sigreceived, stop_charshunt, 0);
close(pty_master);
pty_master = -1;
record_child(cpid, "pppd (charshunt)", charshunt_done, NULL);
return 1;
}
record_child(cpid, "pppd (charshunt)", charshunt_done, NULL);
return 1;
}