Changeset 55cb6b in git for Singular/cntrlc.cc


Ignore:
Timestamp:
Apr 10, 2013, 4:04:09 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ccae2f26143f71606cceb669458d60a2c39c4654
Parents:
c60380d927be780ce0fe437b14c03e70f0df8f5984299e1e1d2b92c5e28fc52391cc529f8eb8ade7
Message:
Merge pull request #317 from mmklee/factory_flint_built

fix: include problems when compiling without NTL but with FLINT
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/cntrlc.cc

    r84299e r55cb6b  
    2626#include <kernel/febase.h>
    2727void sig_chld_hdl(int sig); /*#include <Singular/links/ssiLink.h>*/
     28//#include <Singular/feOpt.h>
     29//#include <Singular/version.h>
     30//#include <Singular/silink.h>
     31//#include <Singular/ssiLink.h>
     32#include <Singular/si_signals.h>
    2833
    2934#include "tok.h"
     
    138143     fprintf(stderr, "Unable to init signal %d ... exiting...\n", sig);
    139144  }
    140 #ifdef HAVE_SIGINTERRUPT
    141   siginterrupt(sig, 0);
     145  si_siginterrupt(sig, 0);
    142146  /*system calls will be restarted if interrupted by  the  specified
    143147   * signal sig.  This is the default behavior in Linux.
    144148   */
    145 #endif
    146149#else
    147150  struct sigaction new_action,old_action;
     
    154157    new_action.sa_flags = SA_RESTART;
    155158
    156   int r=sigaction (sig, &new_action, &old_action);
     159  int r=si_sigaction (sig, &new_action, &old_action);
    157160  si_hdl_typ retval=(si_hdl_typ)old_action.sa_handler;
    158161  if (r == -1)
     
    498501  if (pid == 0)
    499502  {
    500     close (0); dup2 (in_fd[0],0);   /* set the stdin to the in pipe */
    501     close (1); dup2 (out_fd[1],1);  /* set the stdout to the out pipe */
    502     close (2); dup2 (out_fd[1],2);  /* set the stderr to the out pipe */
     503    si_close (0); si_dup2 (in_fd[0],0);   /* set the stdin to the in pipe */
     504    si_close (1); si_dup2 (out_fd[1],1);  /* set the stdout to the out pipe */
     505    si_close (2); si_dup2 (out_fd[1],2);  /* set the stderr to the out pipe */
    503506
    504507    execvp (args[0], args);      /* exec gdb */
     
    515518  FD_SET (out_fd[0], &fdset);
    516519
    517   write (in_fd[1], "backtrace\n", 10);
    518   write (in_fd[1], "p si_stop_stack_trace_x = 0\n", 28);
    519   write (in_fd[1], "quit\n", 5);
     520  si_write (in_fd[1], "backtrace\n", 10);
     521  si_write (in_fd[1], "p si_stop_stack_trace_x = 0\n", 28);
     522  si_write (in_fd[1], "quit\n", 5);
    520523
    521524  index = 0;
     
    528531    tv.tv_usec = 0;
    529532
    530     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
     533    sel = si_select (FD_SETSIZE, &readset, NULL, NULL, &tv);
    531534    if (sel == -1)
    532535      break;
     
    534537    if ((sel > 0) && (FD_ISSET (out_fd[0], &readset)))
    535538    {
    536       if (read (out_fd[0], &c, 1))
     539      if (si_read (out_fd[0], &c, 1))
    537540      {
    538541        switch (state)
     
    565568  }
    566569
    567   close (in_fd[0]);
    568   close (in_fd[1]);
    569   close (out_fd[0]);
    570   close (out_fd[1]);
     570  si_close (in_fd[0]);
     571  si_close (in_fd[1]);
     572  si_close (out_fd[0]);
     573  si_close (out_fd[1]);
    571574  m2_end(0);
    572575}
Note: See TracChangeset for help on using the changeset viewer.