Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/slattach PR/45759: Khanh-Dang Nguyen Thu Lam: slattach(...



details:   https://anonhg.NetBSD.org/src/rev/1e6564a67795
branches:  trunk
changeset: 772322:1e6564a67795
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Dec 30 03:19:36 2011 +0000

description:
PR/45759: Khanh-Dang Nguyen Thu Lam: slattach(8) is not compatible with
pseudo-terminals. Fixed by ignoring the error for the DTR ioctl.

diffstat:

 sbin/slattach/slattach.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 442172c7a06d -r 1e6564a67795 sbin/slattach/slattach.c
--- a/sbin/slattach/slattach.c  Thu Dec 29 23:47:21 2011 +0000
+++ b/sbin/slattach/slattach.c  Fri Dec 30 03:19:36 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: slattach.c,v 1.31 2011/08/27 18:55:21 joerg Exp $      */
+/*     $NetBSD: slattach.c,v 1.32 2011/12/30 03:19:36 christos Exp $   */
 
 /*
  * Copyright (c) 1988, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)slattach.c 8.2 (Berkeley) 1/7/94";
 #else
-__RCSID("$NetBSD: slattach.c,v 1.31 2011/08/27 18:55:21 joerg Exp $");
+__RCSID("$NetBSD: slattach.c,v 1.32 2011/12/30 03:19:36 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,6 +55,7 @@
 #include <netinet/in.h>
 
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <netdb.h>
 #include <paths.h>
@@ -135,7 +136,7 @@
        cfsetspeed(&tty, speed);
        if (tcsetattr(fd, TCSADRAIN, &tty) < 0)
                err(1, "tcsetattr");
-       if (ioctl(fd, TIOCSDTR, 0) < 0)
+       if (ioctl(fd, TIOCSDTR, 0) < 0 && errno != ENOTTY)
                err(1, "TIOCSDTR");
        if (ioctl(fd, TIOCSETD, &slipdisc) < 0)
                err(1, "TIOCSETD");



Home | Main Index | Thread Index | Old Index