mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 20:39:33 +08:00
* fhandler.h (fhandler_process::pid): New field.
(fhandler_process::fstat): Remove unneeded array. Set pid element. (fhandler_process::open): Ditto. (fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
This commit is contained in:
parent
ccacec81db
commit
fdf0b5de28
@ -1,3 +1,10 @@
|
|||||||
|
2002-06-30 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* fhandler.h (fhandler_process::pid): New field.
|
||||||
|
(fhandler_process::fstat): Remove unneeded array. Set pid element.
|
||||||
|
(fhandler_process::open): Ditto.
|
||||||
|
(fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
|
||||||
|
|
||||||
2002-06-30 Christopher Faylor <cgf@redhat.com>
|
2002-06-30 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* fhandler.h (fhandler_process::p): New field.
|
* fhandler.h (fhandler_process::p): New field.
|
||||||
|
@ -1107,7 +1107,6 @@ class fhandler_proc: public fhandler_virtual
|
|||||||
void fill_filebuf ();
|
void fill_filebuf ();
|
||||||
};
|
};
|
||||||
|
|
||||||
class pinfo;
|
|
||||||
class fhandler_registry: public fhandler_proc
|
class fhandler_registry: public fhandler_proc
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -1125,9 +1124,10 @@ class fhandler_registry: public fhandler_proc
|
|||||||
void fill_filebuf ();
|
void fill_filebuf ();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _pinfo;
|
class pinfo;
|
||||||
class fhandler_process: public fhandler_proc
|
class fhandler_process: public fhandler_proc
|
||||||
{
|
{
|
||||||
|
pid_t pid;
|
||||||
pinfo *p;
|
pinfo *p;
|
||||||
public:
|
public:
|
||||||
fhandler_process ();
|
fhandler_process ();
|
||||||
|
@ -100,12 +100,11 @@ fhandler_process::fstat (struct __stat64 *buf, path_conv *pc)
|
|||||||
int file_type = exists ();
|
int file_type = exists ();
|
||||||
(void) fhandler_base::fstat (buf, pc);
|
(void) fhandler_base::fstat (buf, pc);
|
||||||
path += proc_len + 1;
|
path += proc_len + 1;
|
||||||
int pid = atoi (path);
|
pid = atoi (path);
|
||||||
winpids pids;
|
|
||||||
pinfo p (pid);
|
pinfo p (pid);
|
||||||
if (!p)
|
if (!p)
|
||||||
{
|
{
|
||||||
set_errno(ENOENT);
|
set_errno (ENOENT);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,8 +153,7 @@ fhandler_process::readdir (DIR * dir)
|
|||||||
int
|
int
|
||||||
fhandler_process::open (path_conv *pc, int flags, mode_t mode)
|
fhandler_process::open (path_conv *pc, int flags, mode_t mode)
|
||||||
{
|
{
|
||||||
int process_file_no = -1, pid;
|
int process_file_no = -1;
|
||||||
winpids pids;
|
|
||||||
|
|
||||||
int res = fhandler_virtual::open (pc, flags, mode);
|
int res = fhandler_virtual::open (pc, flags, mode);
|
||||||
if (!res)
|
if (!res)
|
||||||
@ -249,6 +247,17 @@ out:
|
|||||||
void
|
void
|
||||||
fhandler_process::fill_filebuf ()
|
fhandler_process::fill_filebuf ()
|
||||||
{
|
{
|
||||||
|
pinfo pmaybe;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
{
|
||||||
|
pmaybe.init (pid);
|
||||||
|
p = &pmaybe;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (fileid)
|
switch (fileid)
|
||||||
{
|
{
|
||||||
case PROCESS_UID:
|
case PROCESS_UID:
|
||||||
@ -349,6 +358,9 @@ fhandler_process::fill_filebuf ()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p == &pmaybe)
|
||||||
|
p = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
Loading…
x
Reference in New Issue
Block a user