X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_ttyflags.c;fp=ncurses%2Ftinfo%2Flib_ttyflags.c;h=ab9c004536ac29ed7789bfdc561120f06d77b35b;hp=8c420e8232eb4d1d5506b5eb5153d2f0e09c9dae;hb=a8987e73ec254703634802b4f7ee30d3a485524d;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index 8c420e82..ab9c0045 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * + * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,7 +38,7 @@ #include #include /* cur_term */ -MODULE_ID("$Id: lib_ttyflags.c,v 1.9 2002/10/12 21:28:16 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.11 2003/05/17 23:50:37 tom Exp $") #undef tabs @@ -60,8 +60,10 @@ NCURSES_EXPORT(int) _nc_get_tty_mode(TTY * buf) { if (cur_term == 0 - || GET_TTY(cur_term->Filedes, buf) != 0) + || GET_TTY(cur_term->Filedes, buf) != 0) { + memset(buf, 0, sizeof(*buf)); return (ERR); + } TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", cur_term->Filedes, _nc_trace_ttymode(buf))); return (OK); @@ -71,8 +73,11 @@ NCURSES_EXPORT(int) _nc_set_tty_mode(TTY * buf) { if (cur_term == 0 - || SET_TTY(cur_term->Filedes, buf) != 0) + || SET_TTY(cur_term->Filedes, buf) != 0) { + if ((errno == ENOTTY) && (SP != 0)) + SP->_notty = TRUE; return (ERR); + } TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", cur_term->Filedes, _nc_trace_ttymode(buf))); return (OK);