tools: move lxc-cgroup to API symbols only

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