Changeset 65041c in git for kernel


Ignore:
Timestamp:
Oct 12, 2016, 11:23:29 AM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
54d5229170cefd9fd9156ac39f061d309f193b57
Parents:
6865a515676783a93fc67ca4c11e6931b8df506a
Message:
additional tests for unusual tty configurations, error msg for -b
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/oswrapper/fereadl.c

    r6865a5 r65041c  
    141141  return c;
    142142}
    143 void fe_init (void)
     143static void fe_init (void)
    144144{
    145145  fe_is_initialized=TRUE;
     
    158158    {
    159159      fe_stdout_is_tty=0;
    160       fe_echo = fopen( ttyname(fileno(stdin)), "w" );
     160      char *tty_name=ttyname(fileno(stdin));
     161      if (tty_name!=NULL)
     162        fe_echo = fopen( tty_name, "w" );
     163      else
     164        fe_echo = NULL;
     165      if (fe_echo==NULL)
     166      {
     167        fe_echo=stdout;
     168        printf("stdin is a tty, but ttyname fails\n");
     169        return;
     170      }
    161171    }
    162172    /* Save the terminal attributes so we can restore them later. */
Note: See TracChangeset for help on using the changeset viewer.