* fhandler.h (fhandler_pipe::broken_pipe): Renamed from saweof.
(fhandler_pipe::set_eof): Reflect above change. * pipe.cc (fhandler_pipe::fhandler_pipe): Ditto. (fhandler_pipe::read): Ditto. (fhandler_pipe::hiteof): Ditto.
This commit is contained in:
parent
6e8b4dcdf1
commit
e25e893d6b
|
@ -1,3 +1,11 @@
|
||||||
|
2001-11-04 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* fhandler.h (fhandler_pipe::broken_pipe): Renamed from saweof.
|
||||||
|
(fhandler_pipe::set_eof): Reflect above change.
|
||||||
|
* pipe.cc (fhandler_pipe::fhandler_pipe): Ditto.
|
||||||
|
(fhandler_pipe::read): Ditto.
|
||||||
|
(fhandler_pipe::hiteof): Ditto.
|
||||||
|
|
||||||
2001-11-04 Christopher Faylor <cgf@redhat.com>
|
2001-11-04 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* pipe.cc (fhandler_pipe::read): Narrow eof return to just the "broken
|
* pipe.cc (fhandler_pipe::read): Narrow eof return to just the "broken
|
||||||
|
|
|
@ -391,7 +391,7 @@ class fhandler_socket: public fhandler_base
|
||||||
class fhandler_pipe: public fhandler_base
|
class fhandler_pipe: public fhandler_base
|
||||||
{
|
{
|
||||||
HANDLE guard;
|
HANDLE guard;
|
||||||
bool saweof;
|
bool broken_pipe;
|
||||||
HANDLE writepipe_exists;
|
HANDLE writepipe_exists;
|
||||||
DWORD orig_pid;
|
DWORD orig_pid;
|
||||||
unsigned id;
|
unsigned id;
|
||||||
|
@ -408,7 +408,7 @@ class fhandler_pipe: public fhandler_base
|
||||||
int dup (fhandler_base *child);
|
int dup (fhandler_base *child);
|
||||||
void fixup_after_fork (HANDLE);
|
void fixup_after_fork (HANDLE);
|
||||||
bool hit_eof ();
|
bool hit_eof ();
|
||||||
void set_eof () {saweof = true;}
|
void set_eof () {broken_pipe = true;}
|
||||||
friend int make_pipe (int fildes[2], unsigned int psize, int mode);
|
friend int make_pipe (int fildes[2], unsigned int psize, int mode);
|
||||||
HANDLE get_guard () const {return guard;}
|
HANDLE get_guard () const {return guard;}
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@ static unsigned pipecount;
|
||||||
static const NO_COPY char pipeid_fmt[] = "stupid_pipe.%u.%u";
|
static const NO_COPY char pipeid_fmt[] = "stupid_pipe.%u.%u";
|
||||||
|
|
||||||
fhandler_pipe::fhandler_pipe (DWORD devtype)
|
fhandler_pipe::fhandler_pipe (DWORD devtype)
|
||||||
: fhandler_base (devtype), guard (NULL), saweof (false), writepipe_exists(0),
|
: fhandler_base (devtype), guard (NULL), broken_pipe (false), writepipe_exists(0),
|
||||||
orig_pid (0), id (0)
|
orig_pid (0), id (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ fhandler_pipe::set_close_on_exec (int val)
|
||||||
int __stdcall
|
int __stdcall
|
||||||
fhandler_pipe::read (void *in_ptr, size_t in_len)
|
fhandler_pipe::read (void *in_ptr, size_t in_len)
|
||||||
{
|
{
|
||||||
if (saweof)
|
if (broken_pipe)
|
||||||
return 0;
|
return 0;
|
||||||
int res = this->fhandler_base::read (in_ptr, in_len);
|
int res = this->fhandler_base::read (in_ptr, in_len);
|
||||||
(void) ReleaseMutex (guard);
|
(void) ReleaseMutex (guard);
|
||||||
|
@ -74,7 +74,7 @@ fhandler_pipe::hit_eof ()
|
||||||
{
|
{
|
||||||
char buf[80];
|
char buf[80];
|
||||||
HANDLE ev;
|
HANDLE ev;
|
||||||
if (saweof)
|
if (broken_pipe)
|
||||||
return 1;
|
return 1;
|
||||||
if (!orig_pid)
|
if (!orig_pid)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue