From a871ff6bdf3925e7a13f7a1b5ea40ca936654537 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 30 Mar 2009 14:02:19 +0200 Subject: [PATCH] cleanup config.h Rename lxc_config.h to confile.h Signed-off-by: Daniel Lezcano --- src/lxc/Makefile.am | 4 ++-- src/lxc/{lxc_config.c => confile.c} | 12 ++++++------ src/lxc/{lxc_config.h => confile.h} | 0 src/lxc/lxc_create.c | 2 +- src/lxc/lxc_execute.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/lxc/{lxc_config.c => confile.c} (99%) rename src/lxc/{lxc_config.h => confile.h} (100%) diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index a48db135e..bf9bb88a6 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -85,7 +85,7 @@ lxc_unshare_LDADD = liblxc.la lxc_init_SOURCES = lxc_init.c lxc_init_LDADD = liblxc.la -lxc_create_SOURCES = lxc_create.c lxc_config.c lxc_config.h +lxc_create_SOURCES = lxc_create.c confile.c confile.h lxc_create_LDADD = liblxc.la lxc_destroy_SOURCES = lxc_destroy.c @@ -97,7 +97,7 @@ lxc_start_LDADD = liblxc.la lxc_stop_SOURCES = lxc_stop.c lxc_stop_LDADD = liblxc.la -lxc_execute_SOURCES = lxc_execute.c lxc_config.c lxc_config.h +lxc_execute_SOURCES = lxc_execute.c confile.c confile.h lxc_execute_LDADD = liblxc.la lxc_monitor_SOURCES = lxc_monitor.c diff --git a/src/lxc/lxc_config.c b/src/lxc/confile.c similarity index 99% rename from src/lxc/lxc_config.c rename to src/lxc/confile.c index 1637f2068..4a2fc5cf2 100644 --- a/src/lxc/lxc_config.c +++ b/src/lxc/confile.c @@ -83,7 +83,7 @@ static struct config *getconfig(const char *key) int i; for (i = 0; i < config_size; i++) - if (!strncmp(config[i].name, key, + if (!strncmp(config[i].name, key, strlen(config[i].name))) return &config[i]; return NULL; @@ -102,7 +102,7 @@ static int config_network_type(const char *key, char *value, struct lxc_conf *lx lxc_log_syserror("failed to allocate memory"); return -1; } - + lxc_list_init(&network->netdev); netdev = malloc(sizeof(*netdev)); @@ -136,7 +136,7 @@ static int config_network_type(const char *key, char *value, struct lxc_conf *lx list->elem = network; lxc_list_add(networks, list); - + if (!strcmp(value, "veth")) network->type = VETH; else if (!strcmp(value, "macvlan")) @@ -442,7 +442,7 @@ static int config_cgroup(const char *key, char *value, struct lxc_conf *lxc_conf if (strlen(subkey) == strlen(token)) return -1; - + subkey += strlen(token); cglist = malloc(sizeof(*cglist)); @@ -507,7 +507,7 @@ static int config_utsname(const char *key, char *value, struct lxc_conf *lxc_con } if (strlen(value) >= sizeof(utsname->nodename)) { - lxc_log_error("node name '%s' is too long", + lxc_log_error("node name '%s' is too long", utsname->nodename); return -1; } @@ -538,7 +538,7 @@ static int parse_line(void *buffer, void *data) lxc_log_error("invalid configuration line: %s", line); return -1; } - + *dot = '\0'; value = dot + 1; diff --git a/src/lxc/lxc_config.h b/src/lxc/confile.h similarity index 100% rename from src/lxc/lxc_config.h rename to src/lxc/confile.h diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c index dccdccfad..12e14f9e2 100644 --- a/src/lxc/lxc_create.c +++ b/src/lxc/lxc_create.c @@ -32,7 +32,7 @@ #include #include -#include +#include "confile.h" void usage(char *cmd) { diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c index 66f66fde1..bdf65aa13 100644 --- a/src/lxc/lxc_execute.c +++ b/src/lxc/lxc_execute.c @@ -31,7 +31,7 @@ #include #include -#include +#include "confile.h" void usage(char *cmd) {