diff th_file.c @ 457:85fa3d333556

Actually, revert the boolean changes .. meh.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Jan 2018 23:09:29 +0200
parents 347bfd3e017e
children 77d1af382e08
line wrap: on
line diff
--- a/th_file.c	Tue Jan 02 22:57:47 2018 +0200
+++ b/th_file.c	Tue Jan 02 23:09:29 2018 +0200
@@ -69,7 +69,7 @@
 }
 
 
-bool th_stat_path(const char *path, int *flags)
+BOOL th_stat_path(const char *path, int *flags)
 {
     *flags = 0;
 
@@ -83,22 +83,22 @@
     uid_t id = geteuid();
     struct stat sb;
     if (stat(path, &sb) < 0)
-        return false;
+        return FALSE;
 
     *flags |= S_ISDIR(sb.st_mode) ? TH_IS_DIR : 0;
     *flags |= (id == sb.st_uid && (sb.st_mode & S_IWUSR)) ? TH_IS_WRITABLE : 0;
     *flags |= (id == sb.st_uid && (sb.st_mode & S_IRUSR)) ? TH_IS_READABLE : 0;
 #endif
 
-    return true;
+    return TRUE;
 }
 
 
-bool th_mkdir_path(const char *cpath, int mode)
+BOOL th_mkdir_path(const char *cpath, int mode)
 {
     char save, *path = th_strdup(cpath);
     size_t start = 0, end;
-    bool res = false;
+    BOOL res = FALSE;
 
     // If mode is 0, default to something sensible
     if (mode == 0)
@@ -120,7 +120,7 @@
         if (path[start] != 0)
         {
             int flags;
-            bool exists = th_stat_path(path, &flags);
+            BOOL exists = th_stat_path(path, &flags);
             if (exists && (flags & TH_IS_DIR) == 0)
                 goto error;
 
@@ -141,7 +141,7 @@
         start = end + 1;
     } while (save != 0);
 
-    res = true;
+    res = TRUE;
 
 error:
     th_free(path);