chiark / gitweb /
Prep v233: Unmask now needed functions in src/basic
[elogind.git] / src / basic / rm-rf.h
index 40b5b527d57265e98f7994dbdbea8eae82ab5f78..e13f7003e3e73d515466ff91bfc15e9be58376fc 100644 (file)
@@ -32,10 +32,8 @@ int rm_rf_children(int fd, RemoveFlags flags, struct stat *root_dev);
 int rm_rf(const char *path, RemoveFlags flags);
 
 /* Useful for usage with _cleanup_(), destroys a directory and frees the pointer */
-static inline void rm_rf_and_free(char *p) {
-        if (!p)
-                return;
-        (void) rm_rf(p, REMOVE_ROOT);
+static inline void rm_rf_physical_and_free(char *p) {
+        (void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL);
         free(p);
 }
-DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rm_rf_and_free);
+DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rm_rf_physical_and_free);