From 2f6085f0f68a27930be08513f552443a3588430a Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 4 Apr 2013 13:37:12 +0900 Subject: [PATCH] modify the clist Change-Id: I572463e7d34cb2f87a467ba2c35a7c6892bcf68d --- module/xdbg_module_clist.c | 55 +++++----------------------------------------- module/xdbg_module_clist.h | 2 +- 2 files changed, 7 insertions(+), 50 deletions(-) mode change 100644 => 100755 module/xdbg_module_clist.h diff --git a/module/xdbg_module_clist.c b/module/xdbg_module_clist.c index 82bad99..48c9aad 100755 --- a/module/xdbg_module_clist.c +++ b/module/xdbg_module_clist.c @@ -34,59 +34,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include -#include -#include -#include -#include -#include -#include -#include -#include - -#define XREGISTRY -#include #include "xdbg.h" #include "xdbg_module_types.h" -static void -_findSyncAwait (pointer value, XID id, pointer cdata) -{ - Bool *sync_await = cdata; - - if (sync_await) - *sync_await = TRUE; -} - void -xDbgModuleCList (XDbgModule *pMod, char *reply, int *remain) +xDbgModuleCList (XDbgModule *pMod, char *reply, int *len) { - char *p = reply; - int i, len; - RESTYPE res_type = 0; - const char *name; + int i; - len = snprintf (p, *remain, "%6s %6s %s %s %s\n", "INDEX", "PID", "SYNC_AWAIT", "BLOCKED", "NAME"); - p += len; - *remain -= len; + XDBG_REPLY ("%6s %6s %s %s\n", "INDEX", "PID", "BLOCKED", "NAME"); - /* get the res_type of SyncAwait */ - for (i = 0; i < lastResourceType; i++) - { - name = LookupResourceName(i + 1); - if (!strcmp(name, "SyncAwait")) - { - res_type = i + 1; - break; - } - } - - for (i = 1; i < currentMaxClients && (0 < *remain); i++) + for (i = 1; i < currentMaxClients && (0 < *len); i++) { ClientPtr pClient = clients[i]; ModuleClientInfo *info; - Bool sync_await; if (!pClient) continue; @@ -95,13 +58,7 @@ xDbgModuleCList (XDbgModule *pMod, char *reply, int *remain) if (!info) continue; - /* find SyncAwait resources */ - sync_await = FALSE; - FindClientResourcesByType (pClient, res_type, _findSyncAwait, &sync_await); - - len = snprintf (p, *remain, "%6d %6d %4d %4d %9s\n", - info->index, info->pid, sync_await, pClient->ignoreCount, info->command); - p += len; - *remain -= len; + XDBG_REPLY ("%6d %6d %4d %9s\n", + info->index, info->pid, pClient->ignoreCount, info->command); } } diff --git a/module/xdbg_module_clist.h b/module/xdbg_module_clist.h old mode 100644 new mode 100755 index ab4dec1..eaed740 --- a/module/xdbg_module_clist.h +++ b/module/xdbg_module_clist.h @@ -34,6 +34,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xdbg_module_types.h" -void xDbgModuleCList (XDbgModule *pMod, char *reply, int *remain); +void xDbgModuleCList (XDbgModule *pMod, char *reply, int *len); #endif /* __XDBG_MODULE_CLIST_H__ */ \ No newline at end of file -- 2.7.4