]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
silence some warnings
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 22 Jan 2016 22:51:43 +0000 (14:51 -0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 22 Jan 2016 22:51:43 +0000 (14:51 -0800)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgfs.c

diff --git a/cgfs.c b/cgfs.c
index 95b78712d446dbcc7b34287d5d1844659a18b106..fcc2509d5ce1ff568101d0e6179343019a2a2f8c 100644 (file)
--- a/cgfs.c
+++ b/cgfs.c
@@ -433,7 +433,9 @@ static bool recursive_rmdir(const char *dirname)
 
        dir = opendir(dirname);
        if (!dir) {
+#if DEBUG
                fprintf(stderr, "%s: failed to open %s: %s\n", __func__, dirname, strerror(errno));
+#endif
                return false;
        }
 
@@ -456,12 +458,17 @@ static bool recursive_rmdir(const char *dirname)
 
                ret = lstat(pathname, &mystat);
                if (ret) {
+#if DEBUG
                        fprintf(stderr, "%s: failed to stat %s: %s\n", __func__, pathname, strerror(errno));
+#endif
                        continue;
                }
                if (S_ISDIR(mystat.st_mode)) {
-                       if (!recursive_rmdir(pathname))
+                       if (!recursive_rmdir(pathname)) {
+#if DEBUG
                                fprintf(stderr, "Error removing %s\n", pathname);
+#endif
+                       }
                }
        }
 
@@ -472,7 +479,9 @@ static bool recursive_rmdir(const char *dirname)
        }
 
        if (rmdir(dirname) < 0) {
+#if DEBUG
                fprintf(stderr, "%s: failed to delete %s: %s\n", __func__, dirname, strerror(errno));
+#endif
                ret = false;
        }