]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: add clearer for lxc.pts
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 12:55:37 +0000 (14:55 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 May 2017 12:55:37 +0000 (14:55 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index e68de988ee54b05625d257edc512b36040d85f91..267a9506c400766193269f72b7002b392f2a45f1 100644 (file)
@@ -69,6 +69,7 @@ static int clr_config_personality(const char *, struct lxc_conf *);
 
 static int set_config_pts(const char *, const char *, struct lxc_conf *);
 static int get_config_pts(const char *, char *, int, struct lxc_conf *);
+static int clr_config_pts(const char *, struct lxc_conf *);
 
 static int set_config_tty(const char *, const char *, struct lxc_conf *);
 static int get_config_tty(const char *, char *, int, struct lxc_conf *);
@@ -215,7 +216,7 @@ static int get_config_limit(const char *, char *, int, struct lxc_conf *);
 
 static struct lxc_config_t config[] = {
        { "lxc.arch",                 set_config_personality,          get_config_personality,       clr_config_personality, },
-       { "lxc.pts",                  set_config_pts,                  get_config_pts,               NULL },
+       { "lxc.pts",                  set_config_pts,                  get_config_pts,               clr_config_pts, },
        { "lxc.tty",                  set_config_tty,                  get_config_tty,               NULL },
        { "lxc.devttydir",            set_config_ttydir,               get_config_ttydir,            NULL },
        { "lxc.kmsg",                 set_config_kmsg,                 get_config_kmsg,              NULL },
@@ -2859,9 +2860,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
        } else if (strcmp(key, "lxc.monitor.unshare") == 0) {
                c->monitor_unshare = 0;
 
-       } else if (strcmp(key, "lxc.pts") == 0) {
-               c->pts = 0;
-
        } else if (strcmp(key, "lxc.include") == 0) {
                lxc_clear_includes(c);
 
@@ -4084,3 +4082,9 @@ static inline int clr_config_personality(const char *key, struct lxc_conf *c)
        c->personality = -1;
        return 0;
 }
+
+static inline int clr_config_pts(const char *key, struct lxc_conf *c)
+{
+       c->pts = 0;
+       return 0;
+}