From 03e69bdd5ce977e0f5fcadff8a76c0554370b8ca Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 21 Sep 2020 14:11:03 +0200 Subject: [PATCH] infra: fix unnecessary unlink --- kernel/lib_mapfree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/lib_mapfree.c b/kernel/lib_mapfree.c index c0d4217c..c019ecec 100644 --- a/kernel/lib_mapfree.c +++ b/kernel/lib_mapfree.c @@ -217,9 +217,9 @@ struct mapfree_info *mapfree_get(const char *name, int flags) /* allow replacement of a .deleted symlink */ if (flags & O_CREAT) { - const char *check = ordered_readlink(name, NULL); + const char *check = mars_readlink(name, NULL); - if (check && !*check) + if (check && !strcmp(check, MARS_DELETED_STR)) mars_unlink(name); brick_string_free(check);