summaryrefslogtreecommitdiffstats
path: root/api.c
diff options
context:
space:
mode:
authorBalbir Singh <balbir@linux.vnet.ibm.com>2008-04-21 10:46:09 +0000
committerBalbir Singh <balbir@linux.vnet.ibm.com>2008-04-21 10:46:09 +0000
commite62a201d4da2deadf021e5bc7b80f5fc7de44c7b (patch)
treea1bd0d7ef0845cad7f0c1ae219072fa07ac0b39d /api.c
parent5ddac5d87d47ace625a04146b91eed6c1ef9daea (diff)
downloadlibcg-e62a201d4da2deadf021e5bc7b80f5fc7de44c7b.tar.gz
libcg-e62a201d4da2deadf021e5bc7b80f5fc7de44c7b.tar.xz
libcg-e62a201d4da2deadf021e5bc7b80f5fc7de44c7b.zip
chown recursive routines need to return zero on success
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@19 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'api.c')
-rw-r--r--api.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/api.c b/api.c
index b7a224f..9f144a3 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;