]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
chown recursive routines need to return zero on success
authorBalbir Singh <balbir@linux.vnet.ibm.com>
Mon, 21 Apr 2008 10:46:09 +0000 (10:46 +0000)
committerBalbir Singh <balbir@linux.vnet.ibm.com>
Mon, 21 Apr 2008 10:46:09 +0000 (10:46 +0000)
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

api.c

diff --git a/api.c b/api.c
index b7a224f2f9cfc99e01506b3ae057b4a9b5b1dfc8..9f144a307c8811885bdfb40fe23e1e2ae650c04f 100644 (file)
--- 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;