Don't use the `GLIBTOP_PROCESS_*' constants for process states for LibGTop

1999-10-16  Martin Baulig  <martin@home-of-linux.org>

	* procstate.c (glibtop_get_proc_state_p): Don't use the
	`GLIBTOP_PROCESS_*' constants for process states for
	LibGTop 1.0.x.
This commit is contained in:
Martin Baulig
1999-10-16 18:00:54 +00:00
committed by Martin Baulig
parent aaca4e7cd6
commit 7881e4212f
2 changed files with 28 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
1999-10-16 Martin Baulig <martin@home-of-linux.org>
* procstate.c (glibtop_get_proc_state_p): Don't use the
`GLIBTOP_PROCESS_*' constants for process states for
LibGTop 1.0.x.
1999-07-29 Martin Baulig <martin@home-of-linux.org> 1999-07-29 Martin Baulig <martin@home-of-linux.org>
* proctime.c (glibtop_get_proc_time_p): Fix bug reported by * proctime.c (glibtop_get_proc_time_p): Fix bug reported by

View File

@@ -91,6 +91,7 @@ glibtop_get_proc_state_p (glibtop *server,
buf->flags = _glibtop_sysdeps_proc_state | buf->flags = _glibtop_sysdeps_proc_state |
_glibtop_sysdeps_proc_state_new; _glibtop_sysdeps_proc_state_new;
#if LIBGTOP_VERSION_CODE >= 1001000
switch (pinfo [0].kp_proc.p_stat) { switch (pinfo [0].kp_proc.p_stat) {
case SIDL: case SIDL:
buf->state = 0; buf->state = 0;
@@ -110,6 +111,27 @@ glibtop_get_proc_state_p (glibtop *server,
default: default:
return; return;
} }
#else
switch (pinfo [0].kp_proc.p_stat) {
case SIDL:
buf->state = 'S';
break;
case SRUN:
buf->state = 'R';
break;
case SSLEEP:
buf->state = 'S';
break;
case SSTOP:
buf->state = 'T';
break;
case SZOMB:
buf->state = 'Z';
break;
default:
return;
}
#endif
buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE); buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE);
} }