diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-06-10 08:50:59 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-06-10 08:50:59 -0400 |
commit | 696fee7d95194948f7f6a17eab93213b925a846d (patch) | |
tree | 721d2fddc656d48daab01ec2aa6edebedda81dbd /src | |
parent | a72b63536f1da3a97677bf38590f22a962e5fe98 (diff) |
dev-setup: do not create a dangling /proc/kcore symlink
https://bugs.freedesktop.org/show_bug.cgi?id=65382
https://bugs.gentoo.org/472060?id=472060
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/dev-setup.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared/dev-setup.c b/src/shared/dev-setup.c index b0ac02d461..50a187fda9 100644 --- a/src/shared/dev-setup.c +++ b/src/shared/dev-setup.c @@ -54,13 +54,19 @@ void dev_setup(const char *prefix) { const char *j, *k; static const char symlinks[] = - "/proc/kcore\0" "/dev/core\0" + "-/proc/kcore\0" "/dev/core\0" "/proc/self/fd\0" "/dev/fd\0" "/proc/self/fd/0\0" "/dev/stdin\0" "/proc/self/fd/1\0" "/dev/stdout\0" "/proc/self/fd/2\0" "/dev/stderr\0"; NULSTR_FOREACH_PAIR(j, k, symlinks) { + if (j[0] == '-') { + j++; + + if (access(j, F_OK)) + continue; + } if (prefix) { char *linkname; |