shared/unit-files: only put valid unit paths and dropin dirs in the cache

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-08-30 14:10:42 +02:00
parent 29a45fe5aa
commit 890befcf47
2 changed files with 22 additions and 1 deletions
+12
View File
@@ -157,6 +157,18 @@ void strv_print(char **l);
_found; \
})
#define ENDSWITH_SET(p, ...) \
({ \
const char *_p = (p); \
char *_found = NULL, **_i; \
STRV_FOREACH(_i, STRV_MAKE(__VA_ARGS__)) { \
_found = endswith(_p, *_i); \
if (_found) \
break; \
} \
_found; \
})
#define FOREACH_STRING(x, y, ...) \
for (char **_l = STRV_MAKE(({ x = y; }), ##__VA_ARGS__); \
x; \