Changeset 947 for trunk


Ignore:
Timestamp:
Jan 11, 2004, 5:51:02 PM (22 years ago)
Author:
bird
Message:

do close on exec stuff (paranoia and such).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/libiberty/pex-os2.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r946 r947  
    4747#define INCL_BASE
    4848#include <os2.h>
     49
    4950
    5051int
     
    9394      output_desc = pdes[WRITE_PORT];
    9495      last_pipe_input = pdes[READ_PORT];
     96
     97
     98
    9599    }
    96100  else
     
    99103    {
    100104      org_stdin = dup (STDIN_FILE_NO);
     105
    101106      dup2 (input_desc, STDIN_FILE_NO);
     107
    102108      close (input_desc);
    103109    }
     
    105111    {
    106112      org_stdout = dup (STDOUT_FILE_NO);
     113
    107114      dup2 (output_desc, STDOUT_FILE_NO);
     115
    108116      close (output_desc);
    109117    }
     118
    110119  pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_NOWAIT, program, argv);
     120
    111121  if (pipes_supported && input_desc != STDIN_FILE_NO)
    112122    {
    113123      dup2 (org_stdin, STDIN_FILE_NO);
     124
    114125      close (org_stdin);
    115126    }
     
    117128    {
    118129      dup2 (org_stdout, STDOUT_FILE_NO);
     130
    119131      close (org_stdout);
    120132    }
Note: See TracChangeset for help on using the changeset viewer.