summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-06-10 12:50:59 +0000
committerAnthony G. Basile <blueness@gentoo.org>2013-07-07 11:22:02 -0400
commit68db594ba673d5afa40e2646246c5bcbf74d948d (patch)
treedcd66c9a4540c56231fec5727c8ddae95b23e040 /src/udev
parentfaa1ff8ef8d98fe148ac0efab15fcdf0cabdcaae (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 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/dev-setup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/udev/dev-setup.c b/src/udev/dev-setup.c
index b0ac02d461..50a187fda9 100644
--- a/src/udev/dev-setup.c
+++ b/src/udev/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;