Wake, we're libgtop2.7.x, lets get rid of old buf->state format. Now using

* procstate.c: (glibtop_get_proc_state_s): Wake, we're libgtop2.7.x,
	lets get rid of old buf->state format. Now using bitfield instead
	letters.
This commit is contained in:
Benoît Dejean
2004-07-15 20:51:29 +00:00
parent 35db2e7496
commit 9e1b0a2814
2 changed files with 37 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2004-07-15 Benoît Dejean <tazforever@dlfp.org>
* procstate.c: (glibtop_get_proc_state_s): Wake, we're libgtop2.7.x,
lets get rid of old buf->state format. Now using bitfield instead
letters.
2004-07-07 Benoît Dejean <tazforever@dlfp.org>
* procargs.c: (glibtop_get_proc_args_s): Fixed. error is now correctly

View File

@@ -80,7 +80,37 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
return;
p = strrchr (buffer, ')'); *p = '\0';
buf->state = p [2];
switch(p[2])
{
case 'R':
buf->state = GLIBTOP_PROCESS_RUNNING;
break;
case 'Z':
buf->state = GLIBTOP_PROCESS_ZOMBIE;
break;
case 'S':
buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE;
break;
case 'T':
buf->state = GLIBTOP_PROCESS_STOPPED;
break;
case 'D':
buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE;
break;
case 'W':
buf->state = GLIBTOP_PROCESS_SWAPPING;
break;
case 'X':
buf->state = GLIBTOP_PROCESS_DEAD;
break;
}
p = skip_token (buffer); p++; /* pid */
if (G_UNLIKELY(*p++ != '('))