X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_ttyflags.c;h=700ec481271fd56dff9fa79be859575050c0eba6;hp=d0d582513806dd9deb6fa9a59a403504df84ad6f;hb=952539d2f6aa5a3a29adc54488b0d3b66121c888;hpb=3a0d9d27e0cf115ff9dcc6163c251bccaa62bd7d diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index d0d58251..700ec481 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2012 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 * @@ -41,7 +41,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_ttyflags.c,v 1.26 2009/10/24 22:15:47 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.28 2012/01/21 19:21:29 KO.Myung-Hun Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) @@ -105,7 +105,11 @@ NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) result = CallDriver_2(SP_PARM, sgmode, TRUE, buf); #else for (;;) { - if (SET_TTY(termp->Filedes, buf) != 0) { + if ((SET_TTY(termp->Filedes, buf) != 0) +#if USE_KLIBC_KBD + && !isatty(termp->Filedes) +#endif + ) { if (errno == EINTR) continue; if ((errno == ENOTTY) && (SP_PARM != 0)) @@ -186,9 +190,9 @@ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) */ if (_nc_get_tty_mode(&termp->Nttyb) == OK) { #ifdef TERMIOS - termp->Nttyb.c_oflag &= ~OFLAGS_TABS; + termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); #else - termp->Nttyb.sg_flags &= ~XTABS; + termp->Nttyb.sg_flags &= (unsigned) (~XTABS); #endif rc = OK; }