Unverified Commit 59809c4b by Christian Brauner Committed by Stéphane Graber

confile: add clearer for lxc.devttydir

parent d60fa053
...@@ -68,6 +68,7 @@ static int clr_config_tty(const char *, struct lxc_conf *); ...@@ -68,6 +68,7 @@ static int clr_config_tty(const char *, struct lxc_conf *);
static int set_config_ttydir(const char *, const char *, struct lxc_conf *); static int set_config_ttydir(const char *, const char *, struct lxc_conf *);
static int get_config_ttydir(const char *, char *, int, struct lxc_conf *); static int get_config_ttydir(const char *, char *, int, struct lxc_conf *);
static int clr_config_ttydir(const char *, struct lxc_conf *);
static int set_config_kmsg(const char *, const char *, struct lxc_conf *); static int set_config_kmsg(const char *, const char *, struct lxc_conf *);
static int get_config_kmsg(const char *, char *, int, struct lxc_conf *); static int get_config_kmsg(const char *, char *, int, struct lxc_conf *);
...@@ -201,7 +202,7 @@ static struct lxc_config_t config[] = { ...@@ -201,7 +202,7 @@ static struct lxc_config_t config[] = {
{ "lxc.arch", set_config_personality, get_config_personality, clr_config_personality, }, { "lxc.arch", set_config_personality, get_config_personality, clr_config_personality, },
{ "lxc.pts", set_config_pts, get_config_pts, clr_config_pts, }, { "lxc.pts", set_config_pts, get_config_pts, clr_config_pts, },
{ "lxc.tty", set_config_tty, get_config_tty, clr_config_tty, }, { "lxc.tty", set_config_tty, get_config_tty, clr_config_tty, },
{ "lxc.devttydir", set_config_ttydir, get_config_ttydir, NULL }, { "lxc.devttydir", set_config_ttydir, get_config_ttydir, clr_config_ttydir, },
{ "lxc.kmsg", set_config_kmsg, get_config_kmsg, NULL }, { "lxc.kmsg", set_config_kmsg, get_config_kmsg, NULL },
{ "lxc.aa_profile", set_config_lsm_aa_profile, get_config_lsm_aa_profile, NULL }, { "lxc.aa_profile", set_config_lsm_aa_profile, get_config_lsm_aa_profile, NULL },
{ "lxc.aa_allow_incomplete", set_config_lsm_aa_incomplete, get_config_lsm_aa_incomplete, NULL }, { "lxc.aa_allow_incomplete", set_config_lsm_aa_incomplete, get_config_lsm_aa_incomplete, NULL },
...@@ -2596,10 +2597,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) ...@@ -2596,10 +2597,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
free(c->console.path); free(c->console.path);
c->console.path = NULL; c->console.path = NULL;
} else if (strcmp(key, "lxc.devttydir") == 0) {
free(c->ttydir);
c->ttydir = NULL;
} else if (strcmp(key, "lxc.autodev") == 0) { } else if (strcmp(key, "lxc.autodev") == 0) {
c->autodev = 1; c->autodev = 1;
...@@ -3746,3 +3743,10 @@ static inline int clr_config_tty(const char *key, struct lxc_conf *c) ...@@ -3746,3 +3743,10 @@ static inline int clr_config_tty(const char *key, struct lxc_conf *c)
c->tty = 0; c->tty = 0;
return 0; return 0;
} }
static inline int clr_config_ttydir(const char *key, struct lxc_conf *c)
{
free(c->ttydir);
c->ttydir = NULL;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment