Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=gservice.git;a=commitdiff;h=6c25a8cb8f84a6ce6d59fe5e4f5bcd7ad420e47f

commit 6c25a8cb8f84a6ce6d59fe5e4f5bcd7ad420e47f
Author: Priyank <[email protected]>
Date:   Tue Dec 30 00:23:59 2008 +0530

gservice-backend.c: don't remember what i did here

diff --git a/src/gservice-backend.c b/src/gservice-backend.c
index 6640599..582b6f7 100644
--- a/src/gservice-backend.c
+++ b/src/gservice-backend.c
@@ -250,6 +250,14 @@ gsvc_get_service_list (void)
entry->description = gsvc_get_service_description (entry->name);
gsvc_get_service_runlevel_info (entry);
entry->enabled = FALSE;
+                               /*
+                               if (strcmp(entry->name,"single"))
+                               {
+                                       if (gsvc_get_service_status 
(entry->name) == GSVC_ON)
+                                               entry->running = TRUE;
+                                       else
+                                               entry->running = FALSE;
+                               }*/
/* search this service in the list of active services */
/* if found, set it's enabled bit */
tlist = alist;
@@ -312,15 +320,22 @@ gsvc_get_service_status (const char *name)
gint    ret;

cmd = g_strdup_printf ("service %s status", name);
+       g_print ("%s\n", cmd);
pp = popen (cmd, "r");
fgets (line, PATH_MAX, pp);
+       printf ("%s\n", line);
tmp = strtok (line, "[");
tmp = strtok (NULL, "[");
if (tmp != NULL)
{
+               g_print ("scanning service %s\n", name);
g_strstrip (tmp);
+               printf ("%s: %s\n", name, tmp);
if (!strcmp(tmp,"ON"))
+               {
ret = GSVC_ON;
+                       g_print ("%s is ON\n", name);
+               }
else
if (!strcmp(tmp,"OFF"))
ret = GSVC_OFF;
diff --git a/src/gservice-backend.h b/src/gservice-backend.h
index e76327a..1054587 100644
--- a/src/gservice-backend.h
+++ b/src/gservice-backend.h
@@ -6,7 +6,7 @@
#define GSVC_ON         1
#define GSVC_OFF        0
#define GSVC_ERR        -1
-
+
/* service entry structure */
typedef struct _gservice_entry_t
{
@@ -14,6 +14,7 @@ typedef struct _gservice_entry_t
GList*          description;
gboolean        runlevel[7];
gboolean        enabled;
+       gboolean        running;
} gservice_entry_t;

/* returns a list of services */
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to