summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2016-05-20 16:08:24 +0300
committerSven Eden <yamakuzure@gmx.net>2017-06-16 10:12:58 +0200
commit7b6ffe6395e164016636530c2aedaf3f4f9a7830 (patch)
tree4a951fb7dc24026846899a2a73b9332a59db0c52 /src
parentc70aceb85cc08a984cb89d95b47c558ae721e8b8 (diff)
basic: remove rm_rf_and_free, add rm_rf_physical_and_free, use rm_rf_physical_and_freep in tests (#3292)
Some distros don't mount /tmp as tmpfs. For example: https://lists.ubuntu.com/archives/ubuntu-cloud/2016-January/001009.html Some tests: * print 'Attempted to remove disk file system, and we can't allow that.' * don't really cleanup /tmp
Diffstat (limited to 'src')
-rw-r--r--src/basic/rm-rf.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/rm-rf.h b/src/basic/rm-rf.h
index 40b5b527d..f693a5bb7 100644
--- a/src/basic/rm-rf.h
+++ b/src/basic/rm-rf.h
@@ -32,10 +32,10 @@ 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) {
+static inline void rm_rf_physical_and_free(char *p) {
if (!p)
return;
- (void) rm_rf(p, REMOVE_ROOT);
+ (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);