diff -ru wmdiskmon-0.0.1.orig/src/main.c wmdiskmon-0.0.1/src/main.c --- wmdiskmon-0.0.1.orig/src/main.c 2004-02-14 03:00:44 +0600 +++ wmdiskmon-0.0.1/src/main.c 2005-12-11 12:51:15 +0600 @@ -31,6 +31,8 @@ #include #include #include +#include + #include "dockapp.h" #include "backlight_on.xpm" #include "backlight_off.xpm" @@ -90,9 +92,7 @@ static void parse_arguments(int argc, char **argv); static void print_help(char *prog); static void reload_sizes(); -static int my_system (char *cmd); static void part_add (Partition **list, const char *value); -static void free_part (Partition **list); void *xmalloc (size_t size); char *xstrdup (const char *string); @@ -267,8 +267,6 @@ /* called by timer */ static void update() { - static light pre_backlight; - static Bool in_alarm_mode = False; /* get current cpu usage in percent */ reload_sizes(); @@ -518,7 +516,7 @@ char mountp[MAXSTRLEN + 1]; bzero(device, MAXSTRLEN + 1); bzero(mountp, MAXSTRLEN + 1); - sscanf(line, "%s %d %d %d %d%% %s", + sscanf(line, "%s %lu %lu %lu %u%% %s", device, &blocs, &used, &avail, &capacity, mountp); for (j = 0 ; part ; j++) { if (strcmp(device, part->entry) == 0) break; @@ -534,30 +532,6 @@ } -static int my_system (char *cmd) { - int pid; - extern char **environ; - - if (cmd == 0) return 1; - pid = fork (); - if (pid == -1) return -1; - if (pid == 0) { - pid = fork (); - if (pid == 0) { - char *argv[4]; - argv[0] = "sh"; - argv[1] = "-c"; - argv[2] = cmd; - argv[3] = 0; - execve ("/bin/sh", argv, environ); - exit (0); - } - exit (0); - } - return 0; -} - - static void part_add (Partition **list, const char *value) { Partition *lst = *list; Bool ok = True; @@ -583,19 +557,6 @@ } -static void free_part (Partition **list) { - Partition *lst = *list, *next; - while (lst) { - next = lst->next; - FREE(lst->entry); - FREE(lst->mountp); - free(lst); - lst = next; - } - *list = NULL; -} - - void *xmalloc (size_t size) { void *ret = malloc (size); if (ret == NULL) {