Changeset 7488f27


Ignore:
Timestamp:
Feb 10, 2011, 11:59:03 PM (14 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
ab9bf01
Parents:
edd0be7
git-author:
Anders Kaseorg <andersk@mit.edu> (02/10/11 23:51:02)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/10/11 23:59:03)
Message:
Use STDIN_FILENO instead of 0

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r099597c r7488f27  
    3232int stderr_replace(void);
    3333#endif
    34 
    35 #define STDIN 0
    3634
    3735owl_global g;
     
    133131  struct termios tio;
    134132  /* save initial terminal settings */
    135   tcgetattr(0, owl_global_get_startup_tio(&g));
    136 
    137   tcgetattr(0, &tio);
     133  tcgetattr(STDIN_FILENO, owl_global_get_startup_tio(&g));
     134
     135  tcgetattr(STDIN_FILENO, &tio);
    138136  tio.c_iflag &= ~(ISTRIP|IEXTEN);
    139   tio.c_cc[VQUIT] = fpathconf(STDIN, _PC_VDISABLE);
    140   tio.c_cc[VSUSP] = fpathconf(STDIN, _PC_VDISABLE);
    141   tcsetattr(0, TCSAFLUSH, &tio);
     137  tio.c_cc[VQUIT] = fpathconf(STDIN_FILENO, _PC_VDISABLE);
     138  tio.c_cc[VSUSP] = fpathconf(STDIN_FILENO, _PC_VDISABLE);
     139  tcsetattr(STDIN_FILENO, TCSAFLUSH, &tio);
    142140
    143141  /* screen init */
     
    152150  endwin();
    153151  /* restore terminal settings */
    154   tcsetattr(0, TCSAFLUSH, owl_global_get_startup_tio(&g));
     152  tcsetattr(STDIN_FILENO, TCSAFLUSH, owl_global_get_startup_tio(&g));
    155153}
    156154
     
    501499
    502500  /* register STDIN dispatch; throw away return, we won't need it */
    503   owl_select_add_io_dispatch(STDIN, OWL_IO_READ, &owl_process_input, NULL, NULL);
     501  owl_select_add_io_dispatch(STDIN_FILENO, OWL_IO_READ, &owl_process_input, NULL, NULL);
    504502  owl_zephyr_initialize();
    505503
Note: See TracChangeset for help on using the changeset viewer.