util: add safe_closedir() similar to safe_fclose()

This commit is contained in:
Lennart Poettering
2015-09-22 16:30:24 +02:00
parent f6d9c616b6
commit ed0d40229b
5 changed files with 41 additions and 4 deletions
+1 -2
View File
@@ -806,8 +806,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
if (!path)
return -ENOMEM;
if (d)
closedir(d);
safe_closedir(d);
d = opendir(path);
if (!d) {