Deleted Added
full compact
ed.term.c (69408) ed.term.c (83098)
1/* $Header: /src/pub/tcsh/ed.term.c,v 1.25 2000/11/11 23:03:34 christos Exp $ */
1/* $Header: /src/pub/tcsh/ed.term.c,v 1.26 2001/08/06 23:51:09 christos Exp $ */
2/*
3 * ed.term.c: Low level terminal interface
4 */
5/*-
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37#include "sh.h"
38#ifndef WINNT_NATIVE
39
2/*
3 * ed.term.c: Low level terminal interface
4 */
5/*-
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37#include "sh.h"
38#ifndef WINNT_NATIVE
39
40RCSID("$Id: ed.term.c,v 1.25 2000/11/11 23:03:34 christos Exp $")
40RCSID("$Id: ed.term.c,v 1.26 2001/08/06 23:51:09 christos Exp $")
41
42#include "ed.h"
43#include "ed.term.h"
44
45int didsetty = 0;
46ttyperm_t ttylist = {
47 {
48#if defined(POSIX) || defined(TERMIO)

--- 512 unchanged lines hidden (view full) ---

561#elif defined(EGAIN)
562# define OKERROR(e) (((e) == EAGAIN) || ((e) == EINTR))
563#elif defined(EWOULDBLOCK)
564# define OKERROR(e) (((e) == EWOULDBLOCK) || ((e) == EINTR))
565#else
566# define OKERROR(e) ((e) == EINTR)
567#endif
568
41
42#include "ed.h"
43#include "ed.term.h"
44
45int didsetty = 0;
46ttyperm_t ttylist = {
47 {
48#if defined(POSIX) || defined(TERMIO)

--- 512 unchanged lines hidden (view full) ---

561#elif defined(EGAIN)
562# define OKERROR(e) (((e) == EAGAIN) || ((e) == EINTR))
563#elif defined(EWOULDBLOCK)
564# define OKERROR(e) (((e) == EWOULDBLOCK) || ((e) == EINTR))
565#else
566# define OKERROR(e) ((e) == EINTR)
567#endif
568
569#ifdef __NetBSD__
570#define KLUDGE (errno == ENOTTY && count < 10)
571#else
572#define KLUDGE 0
573#endif
574
569/* Retry a system call */
575/* Retry a system call */
576static int count;
570#define RETRY(x) \
577#define RETRY(x) \
571 for (;;) \
578 for (count = 0;; count++) \
572 if ((x) == -1) { \
579 if ((x) == -1) { \
573 if (OKERROR(errno)) \
574 continue; \
575 else \
576 return -1; \
580 if (OKERROR(errno) || KLUDGE) \
581 continue; \
582 else \
583 return -1; \
577 } \
578 else \
579 break \
580
581/*ARGSUSED*/
582void
583dosetty(v, t)
584 Char **v;

--- 566 unchanged lines hidden ---
584 } \
585 else \
586 break \
587
588/*ARGSUSED*/
589void
590dosetty(v, t)
591 Char **v;

--- 566 unchanged lines hidden ---