chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3fd165e
)
base-filesystem: avoid all searching if the link already exists
author
Kay Sievers
<kay@vrfy.org>
Tue, 1 Jul 2014 10:25:38 +0000
(12:25 +0200)
committer
Kay Sievers
<kay@vrfy.org>
Tue, 1 Jul 2014 10:25:38 +0000
(12:25 +0200)
src/shared/base-filesystem.c
patch
|
blob
|
history
diff --git
a/src/shared/base-filesystem.c
b/src/shared/base-filesystem.c
index f68386b8e35ba9d5858fc3f243f7286260158fa6..daaeaca515dea0dbc11055d5f6eccafe755d9408 100644
(file)
--- 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;
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)
/* check if one of the targets exists */
NULSTR_FOREACH(s, table[i].target) {
if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)