[Sysfence-commit] sysfence datastruct.c,1.8,1.9 datastruct.h,1.9,1.10
Status: Alpha
Brought to you by:
emes
|
From: Michal S. <em...@us...> - 2004-06-03 23:42:53
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7398 Modified Files: datastruct.c datastruct.h Log Message: + uids list to string Index: datastruct.h =================================================================== RCS file: /cvsroot/sysfence/sysfence/datastruct.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- datastruct.h 31 May 2004 14:10:06 -0000 1.9 +++ datastruct.h 3 Jun 2004 23:42:41 -0000 1.10 @@ -38,8 +38,9 @@ #define PROC_SLEEP 2 #define PROC_STOP 4 #define PROC_ZOMBIE 8 -#define PROC_UNKNOWN 16 -#define PROC_ANY 31 +#define PROC_UNINT 16 +#define PROC_UNKNOWN 32 +#define PROC_ANY 63 /*************************************************************************** All-purpose list @@ -198,5 +199,6 @@ sf_fs_stat * get_fs_entry_from_list (sf_list *hd, char *path); int get_proc_num (sf_database *db, char statemask, uid_t *uid); char * def_2_string (sf_stat_def *def); +char * uids_2_str (sf_list *hd); /* $Id$ */ Index: datastruct.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/datastruct.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- datastruct.c 31 May 2004 14:10:06 -0000 1.8 +++ datastruct.c 3 Jun 2004 23:42:41 -0000 1.9 @@ -270,9 +270,9 @@ case ST_PROC: snprintf (buf, STRBUF, - "nproc (uid: %s) (state: %s)", + "nproc (uid[0]: %s) (state: %d)", "NIY", - "NIY" + def->arg[1].procstates ); default: break; // to avoid warnings @@ -281,3 +281,15 @@ return buf; } +char * uids_2_str (sf_list *hd) +{ + char *buf = (char *) xalloc (NULL, STRBUF + 1), + *buf2; + + *buf = '\0'; + if (hd) { + buf2 = uids_2_str (hd->next); + snprintf (buf, STRBUF, "%d,%s", *((uid_t *) (hd->el)), buf2); + } + return buf; +} |