1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00

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
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-06-10 08:50:59 -04:00
parent a72b63536f
commit 696fee7d95

View File

@ -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;