From: Lennart Poettering Date: Fri, 19 Dec 2014 00:47:19 +0000 (+0100) Subject: util: make sure rm_rf() can be called on symlinks (with the effect of deleting it) X-Git-Tag: v219~919 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=e02d225b1eaead537243293a9c02f6baa8aaf55d util: make sure rm_rf() can be called on symlinks (with the effect of deleting it) --- diff --git a/src/shared/util.c b/src/shared/util.c index 91cf6705e..dbae55fe3 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -3069,7 +3069,7 @@ static int rm_rf_internal(const char *path, bool only_dirs, bool delete_root, bo fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME); if (fd < 0) { - if (errno != ENOTDIR) + if (errno != ENOTDIR && errno != ELOOP) return -errno; if (!dangerous) {