From: Balbir Singh Date: Mon, 21 Apr 2008 10:46:09 +0000 (+0000) Subject: chown recursive routines need to return zero on success X-Git-Tag: v0.34~289^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e62a201d4da2deadf021e5bc7b80f5fc7de44c7b;p=thirdparty%2Flibcgroup.git chown recursive routines need to return zero on success Signed-off-by: Balbir Singh git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@19 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- diff --git a/api.c b/api.c index b7a224f2..9f144a30 100644 --- a/api.c +++ b/api.c @@ -47,7 +47,7 @@ static char MOUNT_POINT[FILENAME_MAX]; static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group) { - int ret = 1; + int ret = 0; const char *filename = fts->fts_path; dbg("seeing file %s\n", filename); switch (ent->fts_info) { @@ -73,7 +73,7 @@ static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group) */ static int cg_chown_recursive(char **path, uid_t owner, gid_t group) { - int ret = 1; + int ret = 0; dbg("path is %s\n", *path); FTS *fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR | FTS_NOSTAT, NULL); @@ -84,7 +84,7 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group) dbg("fts_read failed\n"); break; } - cg_chown_file(fts, ent, owner, group); + ret = cg_chown_file(fts, ent, owner, group); } fts_close(fts); return ret;