[babl] mk_ancestry: propagate return value



commit 0110dfa5d0a118db7e301466042c15b464338934
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Nov 22 20:44:37 2016 +0100

    mk_ancestry: propagate return value

 babl/babl-cache.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/babl/babl-cache.c b/babl/babl-cache.c
index e1c3dd3..5d19216 100644
--- a/babl/babl-cache.c
+++ b/babl/babl-cache.c
@@ -22,7 +22,7 @@
 #include "babl-internal.h"
 #include "git-version.h"
 
-static void
+static int
 mk_ancestry_iter (const char *path)
 {
   char copy[4096];
@@ -35,18 +35,20 @@ mk_ancestry_iter (const char *path)
       struct stat stat_buf;
       if ( ! (stat (copy, &stat_buf)==0 && S_ISDIR(stat_buf.st_mode)))
       {
-        mk_ancestry_iter (copy);
+        if (mk_ancestry_iter (copy) != 0)
+          return -1;
 #ifndef _WIN32 
-        mkdir (copy, S_IRWXU);
+        return mkdir (copy, S_IRWXU);
 #else
-        mkdir (copy);
+        return mkdir (copy);
 #endif
       }
     }
   }
+  return -1;
 }
 
-static void
+static int
 mk_ancestry (const char *path)
 {
   char copy[4096];
@@ -56,7 +58,7 @@ mk_ancestry (const char *path)
     if (*c == '\\')
       *c = '/';
 #endif
-  mk_ancestry_iter (path);
+  return mk_ancestry_iter (path);
 }
 
 static const char *fish_cache_path (void)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]