From: Dhaval Giani Date: Mon, 17 May 2010 16:15:56 +0000 (+0200) Subject: libcgroup: Fix warnings warning about mixed declarations X-Git-Tag: v0.36~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f89ee52de9f8b0c39cfb6fa7678c8b17807a4f07;p=thirdparty%2Flibcgroup.git libcgroup: Fix warnings warning about mixed declarations 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 --- 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;