diff options
author | Sven Eden <yamakuzure@gmx.net> | 2016-11-30 09:44:44 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:17:14 +0100 |
commit | 821db1ad3458f312617c894af7feadf2c87dfff6 (patch) | |
tree | cfb599b81c8f379cbc50a7e76860ce1277fe5d2c /src/shared/dev-setup.c | |
parent | 8af9597bdb2f17e0220c90299a322cfff3c4195f (diff) |
Prep v220: Remove all source files, taht are not needed to build elogind.
Prep v220: Remove not needed headers, round 1
Prep v220: Remove not needed headers, round 2
Prep v220: Remove not needed headers, round 3
Prep v220: Remove empty source directories
Prep v220: Remove non-empty source directories, that aren't needed by elogind
Prep v220: Remove all root directories that aren't referenced by the elogind build chain.
Prep v220: remove superfluous src/import directory and systemd configurations and policies.
Diffstat (limited to 'src/shared/dev-setup.c')
-rw-r--r-- | src/shared/dev-setup.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/shared/dev-setup.c b/src/shared/dev-setup.c deleted file mode 100644 index 25ad918b8..000000000 --- a/src/shared/dev-setup.c +++ /dev/null @@ -1,72 +0,0 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - -/*** - This file is part of systemd. - - Copyright 2010-2012 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see <http://www.gnu.org/licenses/>. -***/ - -#include <errno.h> -#include <stdlib.h> -#include <unistd.h> - -#include "util.h" -#include "label.h" -#include "path-util.h" -#include "dev-setup.h" - -int dev_setup(const char *prefix, uid_t uid, gid_t gid) { - static const char symlinks[] = - "-/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"; - - const char *j, *k; - int r; - - NULSTR_FOREACH_PAIR(j, k, symlinks) { - _cleanup_free_ char *link_name = NULL; - const char *n; - - if (j[0] == '-') { - j++; - - if (access(j, F_OK) < 0) - continue; - } - - if (prefix) { - link_name = prefix_root(prefix, k); - if (!link_name) - return -ENOMEM; - - n = link_name; - } else - n = k; - - r = symlink_label(j, n); - if (r < 0) - log_debug_errno(r, "Failed to symlink %s to %s: %m", j, n); - - if (uid != UID_INVALID || gid != GID_INVALID) - if (lchown(n, uid, gid) < 0) - log_debug_errno(errno, "Failed to chown %s: %m", n); - } - - return 0; -} |