The cg_chmod_recursive_controller function always returned nozero error
code, even when everything goes well.

Signed-off-by: Jan Safranek <jsafr...@redhat.com>
---

 src/api.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/api.c b/src/api.c
index 66cc2b3..098d2e3 100644
--- a/src/api.c
+++ b/src/api.c
@@ -267,8 +267,10 @@ static int cg_chmod_recursive_controller(char *path, 
mode_t dir_mode,
                ent = fts_read(fts);
                if (!ent) {
                        cgroup_dbg("fts_read failed\n");
-                       last_errno = errno;
-                       final_ret = ECGOTHER;
+                       if (errno != 0) {
+                               last_errno = errno;
+                               final_ret = ECGOTHER;
+                       }
                        break;
                }
                ret = cg_chmod_file(fts, ent, dir_mode, dirm_change,


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to