Changeset 55cb6b in git for Singular/cntrlc.cc
- Timestamp:
- Apr 10, 2013, 4:04:09 PM (11 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- ccae2f26143f71606cceb669458d60a2c39c4654
- Parents:
- c60380d927be780ce0fe437b14c03e70f0df8f5984299e1e1d2b92c5e28fc52391cc529f8eb8ade7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/cntrlc.cc
r84299e r55cb6b 26 26 #include <kernel/febase.h> 27 27 void 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> 28 33 29 34 #include "tok.h" … … 138 143 fprintf(stderr, "Unable to init signal %d ... exiting...\n", sig); 139 144 } 140 #ifdef HAVE_SIGINTERRUPT 141 siginterrupt(sig, 0); 145 si_siginterrupt(sig, 0); 142 146 /*system calls will be restarted if interrupted by the specified 143 147 * signal sig. This is the default behavior in Linux. 144 148 */ 145 #endif146 149 #else 147 150 struct sigaction new_action,old_action; … … 154 157 new_action.sa_flags = SA_RESTART; 155 158 156 int r=si gaction (sig, &new_action, &old_action);159 int r=si_sigaction (sig, &new_action, &old_action); 157 160 si_hdl_typ retval=(si_hdl_typ)old_action.sa_handler; 158 161 if (r == -1) … … 498 501 if (pid == 0) 499 502 { 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 */ 503 506 504 507 execvp (args[0], args); /* exec gdb */ … … 515 518 FD_SET (out_fd[0], &fdset); 516 519 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); 520 523 521 524 index = 0; … … 528 531 tv.tv_usec = 0; 529 532 530 sel = s elect (FD_SETSIZE, &readset, NULL, NULL, &tv);533 sel = si_select (FD_SETSIZE, &readset, NULL, NULL, &tv); 531 534 if (sel == -1) 532 535 break; … … 534 537 if ((sel > 0) && (FD_ISSET (out_fd[0], &readset))) 535 538 { 536 if ( read (out_fd[0], &c, 1))539 if (si_read (out_fd[0], &c, 1)) 537 540 { 538 541 switch (state) … … 565 568 } 566 569 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]); 571 574 m2_end(0); 572 575 }
Note: See TracChangeset
for help on using the changeset viewer.