diff --git a/src/helpers.h b/src/helpers.h index 25758da0..2f7f6722 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -207,22 +207,6 @@ static inline char *fgetval(const char *line, const char *key, char *sep) return realloc(copy, len); } -static inline int is_dir_empty(const char *path) -{ - struct dirent **namelist; - int num; - - num = scandir(path, &namelist, NULL, NULL); - if (num < 0) - return 0; - - for (int i = 0; i < num; i++) - free(namelist[i]); - free(namelist); - - return num >= 3; -} - #endif /* FINIT_HELPERS_H_ */ /** diff --git a/src/tmpfiles.c b/src/tmpfiles.c index ab68e233..c23e23cb 100644 --- a/src/tmpfiles.c +++ b/src/tmpfiles.c @@ -23,6 +23,7 @@ #include "config.h" /* Generated by configure script */ +#include #include #include #include @@ -68,6 +69,22 @@ int kerndebug; int c_flag = 0; int r_flag = 0; +static int is_dir_empty(const char *path) +{ + struct dirent **namelist; + int num; + + num = scandir(path, &namelist, NULL, NULL); + if (num < 0) + return 0; + + for (int i = 0; i < num; i++) + free(namelist[i]); + free(namelist); + + return num >= 3; +} + static int glob_do(const char *path, int (*cb)(const char *)) { int rc = 0;