Changeset bc0d32 in git for Singular/links/pipeLink.cc


Ignore:
Timestamp:
Apr 9, 2013, 3:33:02 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
bdda8c2a271e7650c11462d22c70cd15d21d34f1
Parents:
f8565ac2b56eae4e46fb63670efa1bc402ae3628
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-04-09 15:33:02+02:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-04-09 15:33:47+02:00
Message:
add: handling signals in systyem calls
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/links/pipeLink.cc

    rf8565a rbc0d32  
    2727#include "lists.h"
    2828#include "pipeLink.h"
     29#include <Singular/si_signals.h>
    2930
    3031typedef struct
     
    5354  {
    5455    /* close unnecessary pipe descriptors for a clean environment */
    55     close(pc[1]); close(cp[0]);
     56    si_close(pc[1]); si_close(cp[0]);
    5657    /* dup pipe read/write to stdin/stdout */
    57     dup2( pc[0], STDIN_FILENO );
    58     dup2( cp[1], STDOUT_FILENO  );
     58    si_dup2( pc[0], STDIN_FILENO );
     59    si_dup2( cp[1], STDOUT_FILENO  );
    5960    int r=system(l->name);
    60     close(pc[0]);
    61     close(cp[1]);
     61    si_close(pc[0]);
     62    si_close(cp[1]);
    6263    exit(r);
    6364        /* never reached*/
     
    6667  {
    6768    d->pid=pid;
    68     close(pc[0]); close(cp[1]);
     69    si_close(pc[0]); si_close(cp[1]);
    6970    d->f_read=fdopen(cp[0],"r");
    7071    d->fd_read=cp[0];
     
    176177      //Print("test fd %d\n",d->fd_read);
    177178      /* check with select: chars waiting: no -> not ready */
    178       s=select(d->fd_read+1, &mask, NULL, NULL, &wt);
     179      s=si_select(d->fd_read+1, &mask, NULL, NULL, &wt);
    179180    }
    180181    switch (s)
Note: See TracChangeset for help on using the changeset viewer.