From bb190be0bfac956ada4f74a514ff70f28b114efa Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 13 Feb 2016 13:12:29 +0100 Subject: Replace mkpath with g_mkdir_with_parents --- src/fe-common/core/fe-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fe-common') diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index f2c4c014..5bc5c4e1 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -453,7 +453,7 @@ static void autolog_open(SERVER_REC *server, const char *server_tag, log_item_add(log, LOG_ITEM_TARGET, target, server_tag); dir = g_path_get_dirname(log->real_fname); - mkpath(dir, log_dir_create_mode); + g_mkdir_with_parents(dir, log_dir_create_mode); g_free(dir); log->temp = TRUE; -- cgit v1.2.3 From 7a3c6fe86ca55b4ef69b11443b87359b333bc20b Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 13 Feb 2016 14:16:05 +0100 Subject: Replace strarray_length with g_strv_length --- src/fe-common/core/hilight-text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fe-common') diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 36e1e78c..4691a708 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -178,7 +178,7 @@ static HILIGHT_REC *hilight_find(const char *text, char **channels) if (channels == NULL || rec->channels == NULL) continue; /* other doesn't have channels */ - if (strarray_length(channels) != strarray_length(rec->channels)) + if (g_strv_length(channels) != g_strv_length(rec->channels)) continue; /* different amount of channels */ /* check that channels match */ -- cgit v1.2.3 From 0060f682c213dc25901f4c0ab01a01176e14da9e Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 5 Jun 2016 17:24:27 +0200 Subject: Factor out some redundant code and remove hashtable_get_keys --- src/fe-common/core/fe-exec.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/fe-common') diff --git a/src/fe-common/core/fe-exec.c b/src/fe-common/core/fe-exec.c index b5f289ce..36990866 100644 --- a/src/fe-common/core/fe-exec.c +++ b/src/fe-common/core/fe-exec.c @@ -237,22 +237,13 @@ static int signal_name_to_id(const char *name) static int cmd_options_get_signal(const char *cmd, GHashTable *optlist) { - GSList *list, *tmp, *next; + GList *list; char *signame; int signum; /* get all the options, then remove the known ones. there should be only one left - the signal */ - list = hashtable_get_keys(optlist); - if (cmd != NULL) { - for (tmp = list; tmp != NULL; tmp = next) { - char *option = tmp->data; - next = tmp->next; - - if (command_have_option(cmd, option)) - list = g_slist_remove(list, option); - } - } + list = optlist_remove_known(cmd, optlist); if (list == NULL) return -1; @@ -272,7 +263,7 @@ static int cmd_options_get_signal(const char *cmd, return -2; } - g_slist_free(list); + g_list_free(list); return signum; } -- cgit v1.2.3