From f89ee52de9f8b0c39cfb6fa7678c8b17807a4f07 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Mon, 17 May 2010 18:15:56 +0200 Subject: [PATCH] libcgroup: Fix warnings warning about mixed declarations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix warnings like api.c: In function ‘cgroup_walk_tree_begin’: api.c:2647: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] Signed-off-by: Dhaval Giani --- src/api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api.c b/src/api.c index d1d31185..e659717a 100644 --- a/src/api.c +++ b/src/api.c @@ -162,8 +162,10 @@ fail_chown: static int cg_chown_recursive(char **path, uid_t owner, gid_t group) { int ret = 0; + FTS *fts; + cgroup_dbg("path is %s\n", *path); - FTS *fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR | + fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR | FTS_NOSTAT, NULL); while (1) { FTSENT *ent; @@ -2643,7 +2645,6 @@ int cgroup_walk_tree_begin(const char *controller, const char *base_path, int *base_level) { int ret = 0; - cgroup_dbg("path is %s\n", base_path); char *cg_path[2]; char full_path[FILENAME_MAX]; FTSENT *ent; @@ -2655,6 +2656,8 @@ int cgroup_walk_tree_begin(const char *controller, const char *base_path, if (!handle) return ECGINVAL; + cgroup_dbg("path is %s\n", base_path); + if (!cg_build_path(base_path, full_path, controller)) return ECGOTHER; -- 2.47.2