From a4c31ee8e5bdcc69db6205df512ee7edfc791f7a Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 4 Nov 2004 09:59:12 +0000 Subject: [PATCH] Fix the error message when a device name and the socket option are both specified. Make it clearer how ttyfd gets set. --- pppd/tty.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pppd/tty.c b/pppd/tty.c index 4bac648..7d65ba8 100644 --- a/pppd/tty.c +++ b/pppd/tty.c @@ -73,7 +73,7 @@ * 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 #include @@ -459,7 +459,7 @@ tty_check_options() 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) { @@ -656,6 +656,9 @@ int connect_tty() return -1; } + if (using_pty || record_file != NULL) + ttyfd = pty_slave; + /* run connection script */ if ((connector && connector[0]) || initializer) { if (real_ttyfd != -1) { @@ -916,7 +919,6 @@ start_charshunt(ifd, ofd) add_notifier(&sigreceived, stop_charshunt, 0); close(pty_master); pty_master = -1; - ttyfd = pty_slave; record_child(cpid, "pppd (charshunt)", charshunt_done, NULL); return 1; } -- 2.39.2