From 4edb1fbda899b3204641d9aefb8889e75bd7be94 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 27 Mar 2008 00:09:26 +0000 Subject: [PATCH] use sigar_service_exe_get for Service.Exe --- src/sigar_ptql.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sigar_ptql.c b/src/sigar_ptql.c index eeeefd5b..1e70022a 100644 --- a/src/sigar_ptql.c +++ b/src/sigar_ptql.c @@ -780,6 +780,7 @@ static int sigar_services_walk(sigar_services_walker_t *walker, { sigar_services_status_t ss; char buffer[QUERY_SC_SIZE]; + char exe[SIGAR_CMDLINE_MAX]; LPQUERY_SERVICE_CONFIG config = (LPQUERY_SERVICE_CONFIG)buffer; DWORD i, status; @@ -810,10 +811,11 @@ static int sigar_services_walk(sigar_services_walker_t *walker, status = ptql_service_query_config(ss.handle, name, config); if (status == SIGAR_OK) { if (branch->flags == PTQL_PID_SERVICE_EXE) { - value = strrchr(config->lpBinaryPathName, '\\'); - if (value) ++value; + value = + sigar_service_exe_get(config->lpBinaryPathName, + exe, 1); } - if (value == NULL) { + else { value = config->lpBinaryPathName; } }