]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_ttyflags.c
ncurses 5.9 - patch 20130816
[ncurses.git] / ncurses / tinfo / lib_ttyflags.c
index 17b13b2d0c6324f2e3a7d91c86570ad7a852b85e..700ec481271fd56dff9fa79be859575050c0eba6 100644 (file)
@@ -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.25 2009/06/06 19:10:05 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))
@@ -137,7 +141,7 @@ NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("def_shell_mode(%p)"), SP_PARM));
+    T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
@@ -175,7 +179,7 @@ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("def_prog_mode(%p)"), SP_PARM));
+    T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
@@ -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;
        }
@@ -211,7 +215,7 @@ NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("reset_prog_mode(%p)"), SP_PARM));
+    T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
@@ -244,7 +248,7 @@ NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("reset_shell_mode(%p)"), SP_PARM));
+    T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
@@ -293,7 +297,7 @@ saved_tty(NCURSES_SP_DCL0)
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("savetty(%p)"), SP_PARM));
+    T((T_CALLED("savetty(%p)"), (void *) SP_PARM));
     returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG)));
 }
 
@@ -308,7 +312,7 @@ savetty(void)
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("resetty(%p)"), SP_PARM));
+    T((T_CALLED("resetty(%p)"), (void *) SP_PARM));
     returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG)));
 }