* pinfo.h (proc_pipe::*): Delete class.
* pinfo.cc (proc_pipe::*): Ditto.
This commit is contained in:
parent
8c43a9f82e
commit
a8dead4476
|
@ -1,3 +1,8 @@
|
||||||
|
2004-12-06 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* pinfo.h (proc_pipe::*): Delete class.
|
||||||
|
* pinfo.cc (proc_pipe::*): Ditto.
|
||||||
|
|
||||||
2004-12-05 Christopher Faylor <cgf@timesys.com>
|
2004-12-05 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* fork.cc (fork_parent): Reinstate "childhProc" protection. Don't
|
* fork.cc (fork_parent): Reinstate "childhProc" protection. Don't
|
||||||
|
|
|
@ -767,40 +767,6 @@ proc_waiter (void *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
proc_pipe::set (bool closeem)
|
|
||||||
{
|
|
||||||
myself.lock ();
|
|
||||||
if (!CreatePipe (&in, &out, &sec_none_nih, 16))
|
|
||||||
{
|
|
||||||
system_printf ("couldn't create pipe, %E");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* Duplicate the write end of the pipe into the subprocess. Make it inheritable
|
|
||||||
so that all of the execed children get it. */
|
|
||||||
if (!DuplicateHandle (hMainProc, out, hMainProc, &out, 0, TRUE,
|
|
||||||
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
|
|
||||||
{
|
|
||||||
CloseHandle (in);
|
|
||||||
in = out = NULL;
|
|
||||||
system_printf ("couldn't make handle %p noninheritable, %E", out);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_closeem = closeem;
|
|
||||||
}
|
|
||||||
|
|
||||||
proc_pipe::~proc_pipe ()
|
|
||||||
{
|
|
||||||
if (_closeem)
|
|
||||||
{
|
|
||||||
if (in)
|
|
||||||
CloseHandle (in);
|
|
||||||
if (out)
|
|
||||||
CloseHandle (out);
|
|
||||||
}
|
|
||||||
myself.unlock ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* function to set up the process pipe and kick off proc_waiter */
|
/* function to set up the process pipe and kick off proc_waiter */
|
||||||
int
|
int
|
||||||
pinfo::wait ()
|
pinfo::wait ()
|
||||||
|
|
|
@ -179,20 +179,6 @@ public:
|
||||||
void set_acl();
|
void set_acl();
|
||||||
};
|
};
|
||||||
|
|
||||||
class proc_pipe
|
|
||||||
{
|
|
||||||
bool _closeem;
|
|
||||||
public:
|
|
||||||
HANDLE in;
|
|
||||||
HANDLE out;
|
|
||||||
void set (bool);
|
|
||||||
proc_pipe (bool closeem) {set (closeem);}
|
|
||||||
proc_pipe () : _closeem (false), in (NULL), out (NULL) {};
|
|
||||||
void close () {_closeem = true;}
|
|
||||||
~proc_pipe ();
|
|
||||||
int operator == (int x) {return (int) in == x;}
|
|
||||||
};
|
|
||||||
|
|
||||||
#define ISSTATE(p, f) (!!((p)->process_state & f))
|
#define ISSTATE(p, f) (!!((p)->process_state & f))
|
||||||
#define NOTSTATE(p, f) (!((p)->process_state & f))
|
#define NOTSTATE(p, f) (!((p)->process_state & f))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue