]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tools: move lxc-cgroup to API symbols only
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 12 Jan 2018 12:36:12 +0000 (13:36 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 6 Feb 2018 20:03:32 +0000 (21:03 +0100)
Closes #2073.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/tools/arguments.h
src/lxc/tools/lxc_cgroup.c

index 15941bcc396b6cb4a3fc0795da9bfcb02bf225c8..bd491a32bfdf4435064d62e82820e417f8da4eb3 100644 (file)
@@ -31,6 +31,7 @@
 #include <sys/types.h>
 #include <lxc/lxccontainer.h>
 
+#define TOOL_MAXPATHLEN 4096
 struct lxc_arguments;
 
 typedef int (*lxc_arguments_parser_t)(struct lxc_arguments *, int, char *);
index cfd14bd8f8f788f9cf6a36d2141c0e59ade9233b..3624e80b7d2bb0e8e6ef6e7a993c7a33f7b8e71a 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define _GNU_SOURCE
 #include <libgen.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 #include <lxc/lxccontainer.h>
 
 #include "arguments.h"
-#include "log.h"
-#include "lxc.h"
 
 static int my_checker(const struct lxc_arguments* args)
 {
@@ -39,6 +39,7 @@ static int my_checker(const struct lxc_arguments* args)
                lxc_error(args, "missing state object");
                return -1;
        }
+
        return 0;
 }
 
@@ -83,7 +84,6 @@ int main(int argc, char *argv[])
 
        if (lxc_log_init(&log))
                exit(EXIT_FAILURE);
-       lxc_log_options_no_override();
 
        /* REMOVE IN LXC 3.0 */
        setenv("LXC_UPDATE_CONFIG_FORMAT", "1", 0);
@@ -130,8 +130,8 @@ int main(int argc, char *argv[])
                        exit(EXIT_FAILURE);
                }
        } else {
-               char buffer[MAXPATHLEN];
-               int ret = c->get_cgroup_item(c, state_object, buffer, MAXPATHLEN);
+               char buffer[TOOL_MAXPATHLEN];
+               int ret = c->get_cgroup_item(c, state_object, buffer, TOOL_MAXPATHLEN);
                if (ret < 0) {
                        fprintf(stderr, "failed to retrieve value of '%s' for '%s:%s'\n",
                              state_object, my_args.lxcpath[0], my_args.name);