File: close.cc

package info (click to toggle)
bobcat 2.08.01-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,668 kB
  • ctags: 953
  • sloc: cpp: 10,403; makefile: 9,042; perl: 401; sh: 195
file content (20 lines) | stat: -rw-r--r-- 714 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "process.ih"

// This function performs the steps taken by setPipes and parentRedirections
// to close the child's cin and to keep the defintions of d_oldIn and
// d_child_inp intact.

void Process::close()
{
    d_oldIn = d_child_inp->writeFd();   
    d_child_inp.reset(newPipe());
    d_childCinbuf.open(d_child_inp->writeOnly());

    d_childCin.rdbuf(&d_childCinbuf);     // not required as d_childCin
                                          // won't be used anymore in this
                                          // run. At parentRedirecions
                                          // it may eventually be
                                          // reassigned again.

    close(d_oldIn);
}