(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>
+ * 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>
+
* fhandler.h (fhandler_process::p): New field.
(fhandler_process:fill_filebuf): Revert to same definition as virtual
in parent class.
void fill_filebuf ();
};
-class pinfo;
class fhandler_registry: public fhandler_proc
{
public:
void fill_filebuf ();
};
-struct _pinfo;
+class pinfo;
class fhandler_process: public fhandler_proc
{
+ pid_t pid;
pinfo *p;
public:
fhandler_process ();
int file_type = exists ();
(void) fhandler_base::fstat (buf, pc);
path += proc_len + 1;
- int pid = atoi (path);
- winpids pids;
+ pid = atoi (path);
pinfo p (pid);
if (!p)
{
- set_errno(ENOENT);
+ set_errno (ENOENT);
return -1;
}
int
fhandler_process::open (path_conv *pc, int flags, mode_t mode)
{
- int process_file_no = -1, pid;
- winpids pids;
+ int process_file_no = -1;
int res = fhandler_virtual::open (pc, flags, mode);
if (!res)
void
fhandler_process::fill_filebuf ()
{
+ pinfo pmaybe;
+
+ if (!p)
+ {
+ pmaybe.init (pid);
+ p = &pmaybe;
+ }
+
+ if (!p)
+ return;
+
switch (fileid)
{
case PROCESS_UID:
break;
}
}
+
+ if (p == &pmaybe)
+ p = NULL;
}
static