tty.c (135166) | tty.c (196513) |
---|---|
1/*- 2 * Copyright (c) 1999 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/usr.sbin/ppp/tty.c 135166 2004-09-13 19:04:03Z ru $ | 26 * $FreeBSD: head/usr.sbin/ppp/tty.c 196513 2009-08-24 17:18:17Z brian $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/un.h> 31#if defined(__OpenBSD__) || defined(__NetBSD__) 32#include <sys/ioctl.h> 33#endif 34 --- 344 unchanged lines hidden (view full) --- 379} 380 381static void 382UnloadLineDiscipline(struct physical *p) 383{ 384 struct ttydevice *dev = device2tty(p->handler); 385 386 if (isngtty(dev)) { | 27 */ 28 29#include <sys/param.h> 30#include <sys/un.h> 31#if defined(__OpenBSD__) || defined(__NetBSD__) 32#include <sys/ioctl.h> 33#endif 34 --- 344 unchanged lines hidden (view full) --- 379} 380 381static void 382UnloadLineDiscipline(struct physical *p) 383{ 384 struct ttydevice *dev = device2tty(p->handler); 385 386 if (isngtty(dev)) { |
387log_Printf(LogPHASE, "back to speed %d\n", dev->real.speed); | |
388 if (!physical_SetSpeed(p, dev->real.speed)) 389 log_Printf(LogWARN, "Couldn't reset tty speed to %d\n", dev->real.speed); 390 dev->real.speed = 0; 391 close(p->fd); 392 p->fd = dev->real.fd; 393 dev->real.fd = -1; 394 close(dev->cs); 395 dev->cs = -1; --- 181 unchanged lines hidden (view full) --- 577 int maxiov __unused, 578#ifndef NONETGRAPH 579 int *auxfd, int *nauxfd 580#else 581 int *auxfd __unused, int *nauxfd __unused 582#endif 583 ) 584{ | 387 if (!physical_SetSpeed(p, dev->real.speed)) 388 log_Printf(LogWARN, "Couldn't reset tty speed to %d\n", dev->real.speed); 389 dev->real.speed = 0; 390 close(p->fd); 391 p->fd = dev->real.fd; 392 dev->real.fd = -1; 393 close(dev->cs); 394 dev->cs = -1; --- 181 unchanged lines hidden (view full) --- 576 int maxiov __unused, 577#ifndef NONETGRAPH 578 int *auxfd, int *nauxfd 579#else 580 int *auxfd __unused, int *nauxfd __unused 581#endif 582 ) 583{ |
585 struct ttydevice *dev = device2tty(d); | 584 struct ttydevice *dev; |
586 int sz = physical_MaxDeviceSize(); 587 | 585 int sz = physical_MaxDeviceSize(); 586 |
588 iov[*niov].iov_base = realloc(d, sz); 589 if (iov[*niov].iov_base == NULL) { | 587 iov[*niov].iov_base = d = realloc(d, sz); 588 if (d == NULL) { |
590 log_Printf(LogALERT, "Failed to allocate memory: %d\n", sz); 591 AbortProgram(EX_OSERR); 592 } 593 iov[*niov].iov_len = sz; 594 (*niov)++; 595 | 589 log_Printf(LogALERT, "Failed to allocate memory: %d\n", sz); 590 AbortProgram(EX_OSERR); 591 } 592 iov[*niov].iov_len = sz; 593 (*niov)++; 594 |
595 dev = device2tty(d); 596 |
|
596#ifndef NONETGRAPH 597 if (dev->cs >= 0) { 598 *auxfd = dev->cs; 599 (*nauxfd)++; 600 } 601#endif 602 603 if (dev->Timer.state != TIMER_STOPPED) { --- 166 unchanged lines hidden --- | 597#ifndef NONETGRAPH 598 if (dev->cs >= 0) { 599 *auxfd = dev->cs; 600 (*nauxfd)++; 601 } 602#endif 603 604 if (dev->Timer.state != TIMER_STOPPED) { --- 166 unchanged lines hidden --- |