[systemd-commits] src/shared

Kay Sievers kay at kemper.freedesktop.org
Tue Jul 1 03:28:07 PDT 2014


 src/shared/base-filesystem.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit afc3f9cb24d1e0ee01dc5841fa4c215e697548de
Author: Kay Sievers <kay at vrfy.org>
Date:   Tue Jul 1 12:25:38 2014 +0200

    base-filesystem: avoid all searching if the link already exists

diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index f68386b..daaeaca 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -65,6 +65,9 @@ int base_filesystem_create(const char *root) {
                         const char *target = NULL;
                         const char *s;
 
+                        if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
+                                continue;
+
                         /* check if one of the targets exists */
                         NULSTR_FOREACH(s, table[i].target) {
                                 if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)



More information about the systemd-commits mailing list