chiark / gitweb /
Prep v228: Add remaining updates from upstream (1/3)
[elogind.git] / src / basic / path-util.c
index 6bdc8342e6807c9c749feb5aa2029942eadeeec9..7b38a01e34314d4eb81c7979e385ec3d92b18226 100644 (file)
@@ -219,7 +219,6 @@ int path_make_relative(const char *from_dir, const char *to_path, char **_r) {
         *_r = r;
         return 0;
 }
-#endif // 0
 
 char **path_strv_make_absolute_cwd(char **l) {
         char **s;
@@ -241,6 +240,7 @@ char **path_strv_make_absolute_cwd(char **l) {
 
         return l;
 }
+#endif // 0
 
 char **path_strv_resolve(char **l, const char *prefix) {
         char **s;
@@ -417,7 +417,7 @@ int path_compare(const char *a, const char *b) {
          * Which one is sorted before the other does not really matter.
          * Here a relative path is ordered before an absolute path. */
         d = (a[0] == '/') - (b[0] == '/');
-        if (d)
+        if (d != 0)
                 return d;
 
         for (;;) {
@@ -440,12 +440,12 @@ int path_compare(const char *a, const char *b) {
 
                 /* Alphabetical sort: "/foo/aaa" before "/foo/b" */
                 d = memcmp(a, b, MIN(j, k));
-                if (d)
+                if (d != 0)
                         return (d > 0) - (d < 0); /* sign of d */
 
                 /* Sort "/foo/a" before "/foo/aaa" */
                 d = (j > k) - (j < k);  /* sign of (j - k) */
-                if (d)
+                if (d != 0)
                         return d;
 
                 a += j;
@@ -719,7 +719,6 @@ int path_is_os_tree(const char *path) {
 
         return r >= 0;
 }
-#endif // 0
 
 int find_binary(const char *name, bool local, char **filename) {
         assert(name);
@@ -773,8 +772,6 @@ int find_binary(const char *name, bool local, char **filename) {
         }
 }
 
-/// UNNEEDED by elogind
-#if 0
 bool paths_check_timestamp(const char* const* paths, usec_t *timestamp, bool update) {
         bool changed = false;
         const char* const* i;
@@ -833,7 +830,6 @@ int fsck_exists(const char *fstype) {
 
         return 0;
 }
-#endif // 0
 
 char *prefix_root(const char *root, const char *path) {
         char *n, *p;
@@ -868,3 +864,4 @@ char *prefix_root(const char *root, const char *path) {
         strcpy(p, path);
         return n;
 }
+#endif // 0