No longer abort() is no such pid. buf.flags == 0ULL means that there no

* procargs.c: (glibtop_get_proc_args_s):
	* prockernel.c: (glibtop_get_proc_kernel_s):
	* procmem.c: (glibtop_get_proc_mem_s):
	* procsegment.c: (glibtop_get_proc_segment_s):
	* procsignal.c: (glibtop_get_proc_signal_s):
	* procstate.c: (glibtop_get_proc_state_s):
	* proctime.c: (glibtop_get_proc_time_s):
	* procuid.c: (glibtop_get_proc_uid_s): No longer abort() is no such pid.
	buf.flags == 0ULL means that there no data could be retrieve at all.
	Closes #154876. Thanks to Christophe Belle.
This commit is contained in:
Benoît Dejean
2004-10-22 15:35:57 +00:00
parent 405f0602e0
commit e6f0664c3b
9 changed files with 21 additions and 47 deletions

View File

@@ -1,3 +1,16 @@
2004-10-22 Benoît Dejean <tazforever@dlfp.org>
* procargs.c: (glibtop_get_proc_args_s):
* prockernel.c: (glibtop_get_proc_kernel_s):
* procmem.c: (glibtop_get_proc_mem_s):
* procsegment.c: (glibtop_get_proc_segment_s):
* procsignal.c: (glibtop_get_proc_signal_s):
* procstate.c: (glibtop_get_proc_state_s):
* proctime.c: (glibtop_get_proc_time_s):
* procuid.c: (glibtop_get_proc_uid_s): No longer abort() is no such pid.
buf.flags == 0ULL means that there no data could be retrieve at all.
Closes #154876. Thanks to Christophe Belle.
2004-10-04 Benoît Dejean <tazforever@dlfp.org> 2004-10-04 Benoît Dejean <tazforever@dlfp.org>
* procstate.c: (glibtop_get_proc_state_s): Fixed .state to follow * procstate.c: (glibtop_get_proc_state_s): Fixed .state to follow

View File

@@ -67,12 +67,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
memset (buf, 0, sizeof (glibtop_proc_args)); memset (buf, 0, sizeof (glibtop_proc_args));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return NULL;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return NULL;
}
size = max_len != 0 ? max_len : 4096; size = max_len != 0 ? max_len : 4096;
args_buffer = g_malloc (size); args_buffer = g_malloc (size);

View File

@@ -62,12 +62,7 @@ glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf,
memset (buf, 0, sizeof (glibtop_proc_kernel)); memset (buf, 0, sizeof (glibtop_proc_kernel));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r(server, "Cannot read procsinfo");
return;
}
if (!(pinfo->pi_flags | SKPROC)) if (!(pinfo->pi_flags | SKPROC))
{ {

View File

@@ -58,12 +58,7 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf,
memset (buf, 0, sizeof (glibtop_proc_mem)); memset (buf, 0, sizeof (glibtop_proc_mem));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
pagesize = sysconf(_SC_PAGESIZE); pagesize = sysconf(_SC_PAGESIZE);

View File

@@ -58,12 +58,7 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
memset (buf, 0, sizeof (glibtop_proc_segment)); memset (buf, 0, sizeof (glibtop_proc_segment));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
pagesize = sysconf(_SC_PAGESIZE); pagesize = sysconf(_SC_PAGESIZE);

View File

@@ -59,12 +59,7 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf,
memset (buf, 0, sizeof (glibtop_proc_signal)); memset (buf, 0, sizeof (glibtop_proc_signal));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
/* pending signals */ /* pending signals */

View File

@@ -58,12 +58,7 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf,
memset (buf, 0, sizeof (glibtop_proc_state)); memset (buf, 0, sizeof (glibtop_proc_state));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r(server, "Cannot read procsinfo");
return;
}
if (pinfo->pi_pid == 0) if (pinfo->pi_pid == 0)
{ {

View File

@@ -56,11 +56,7 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
memset (buf, 0, sizeof (glibtop_proc_time)); memset (buf, 0, sizeof (glibtop_proc_time));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
buf->start_time = pinfo->pi_start; buf->start_time = pinfo->pi_start;
buf->utime = pinfo->pi_ru.ru_utime.tv_sec + (double)pinfo->pi_ru.ru_utime.tv_usec/1000000.0; buf->utime = pinfo->pi_ru.ru_utime.tv_sec + (double)pinfo->pi_ru.ru_utime.tv_usec/1000000.0;

View File

@@ -64,12 +64,7 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf,
memset (buf, 0, sizeof (glibtop_proc_uid)); memset (buf, 0, sizeof (glibtop_proc_uid));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
buf->uid = pinfo->pi_cred.cr_ruid; buf->uid = pinfo->pi_cred.cr_ruid;
buf->euid = pinfo->pi_cred.cr_uid; buf->euid = pinfo->pi_cred.cr_uid;