Changeset 65041c in git


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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/feOpt.cc

    r6865a5 r65041c  
    225225
    226226      case FE_OPT_NO_TTY:
    227 #if defined(HAVE_FEREAD) || defined(HAVE_READLINE)
    228227        if (feOptSpec[FE_OPT_NO_TTY].value)
    229228          fe_fgets_stdin=fe_fgets;
    230 #endif
    231229        return NULL;
    232230
  • Singular/feOptTab.h

    r6865a5 r65041c  
    7373
    7474  {"batch",             no_argument,        'b',
    75    0,          "Run in batch mode",                                    feOptBool,    0,     0},
     75   0,          "Run in batch mode (requires --link/--MPhost/--MPport)",                                    feOptBool,    0,     0},
    7676
    7777  {"execute",           required_argument,  'c',
  • Singular/fevoices.cc

    r6865a5 r65041c  
    668668    p->files=freopen("/dev/tty","r",stdin);
    669669    //stdin=p->files;
    670     p->sw = BI_stdin;
     670    if (p->files==NULL)
     671    {
     672      p->files = stdin;
     673      p->sw = BI_file;
     674    }
     675    else
     676      p->sw = BI_stdin;
    671677  }
    672678  p->filename   = omStrDup("STDIN");
  • Singular/tesths.cc

    r6865a5 r65041c  
    157157  countedref_init();
    158158#endif
    159 // #ifdef HAVE_FANS
    160 //   bbcone_setup();
    161 //   bbpolytope_setup();
    162 //   bbfan_setup();
    163 //   gitfan_setup();
    164 // #endif /* HAVE_FANS */
    165159  errorreported = 0;
    166160
     
    229223      //exit(0);
    230224    }
     225    else
     226    {
     227      Print("** missing arguments: -b requires --link/--MPhost/--MPport\n");
     228      return 1;
     229    }
    231230  }
    232231  setjmp(si_start_jmpbuf);
  • 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.