summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-04-17 02:20:32 +0200
committerKay Sievers <kay@vrfy.org>2012-04-17 02:20:32 +0200
commit3b49d09a3d34ac462573aa96d66c70e9a60417e4 (patch)
tree6709782fbffe2395fe81c5b655451fff3206964c /src/udev
parent9e13dbae509605dba1bde7e7385086b59acb428e (diff)
udev: kill udev_selinux_setfscreateconat()
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udevd.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 513d1de343..20de5cfc28 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -871,36 +871,29 @@ static void static_dev_create_from_modules(struct udev *udev)
/* needed for standalone udev operations */
static void static_dev_create_links(struct udev *udev)
{
- DIR *dir;
struct stdlinks {
const char *link;
const char *target;
};
static const struct stdlinks stdlinks[] = {
- { "core", "/proc/kcore" },
- { "fd", "/proc/self/fd" },
- { "stdin", "/proc/self/fd/0" },
- { "stdout", "/proc/self/fd/1" },
- { "stderr", "/proc/self/fd/2" },
+ { "/dev/core", "/proc/kcore" },
+ { "/dev/fd", "/proc/self/fd" },
+ { "/dev/stdin", "/proc/self/fd/0" },
+ { "/dev/stdout", "/proc/self/fd/1" },
+ { "/dev/stderr", "/proc/self/fd/2" },
};
unsigned int i;
- dir = opendir("/dev");
- if (dir == NULL)
- return;
-
for (i = 0; i < ELEMENTSOF(stdlinks); i++) {
struct stat sb;
if (stat(stdlinks[i].target, &sb) == 0) {
- udev_selinux_setfscreateconat(udev, dirfd(dir), stdlinks[i].link, S_IFLNK);
- if (symlinkat(stdlinks[i].target, dirfd(dir), stdlinks[i].link) < 0 && errno == EEXIST)
- utimensat(dirfd(dir), stdlinks[i].link, NULL, AT_SYMLINK_NOFOLLOW);
+ udev_selinux_setfscreatecon(udev, stdlinks[i].link, S_IFLNK);
+ if (symlink(stdlinks[i].target, stdlinks[i].link) < 0 && errno == EEXIST)
+ utimensat(AT_FDCWD, stdlinks[i].link, NULL, AT_SYMLINK_NOFOLLOW);
udev_selinux_resetfscreatecon(udev);
}
}
-
- closedir(dir);
}
static int mem_size_mb(void)