5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers This file is part of systemd.
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers Copyright 2010-2012 Lennart Poettering
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers systemd is free software; you can redistribute it and/or modify it
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers under the terms of the GNU Lesser General Public License as published by
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers the Free Software Foundation; either version 2.1 of the License, or
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers (at your option) any later version.
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers systemd is distributed in the hope that it will be useful, but
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers WITHOUT ANY WARRANTY; without even the implied warranty of
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers Lesser General Public License for more details.
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers You should have received a copy of the GNU Lesser General Public License
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers along with systemd; If not, see <http://www.gnu.org/licenses/>.
03cfe0d51499e86b1573d121337594719d9f2012Lennart Poetteringint dev_setup(const char *prefix, uid_t uid, gid_t gid) {
5ba2dc259f3cdd8fddef68cfd28380a32534e49aKay Sievers "/proc/self/fd/2\0" "/dev/stderr\0";
03cfe0d51499e86b1573d121337594719d9f2012Lennart Poettering const char *j, *k;
03cfe0d51499e86b1573d121337594719d9f2012Lennart Poettering const char *n;
696fee7d95194948f7f6a17eab93213b925a846dZbigniew Jędrzejewski-Szmek if (j[0] == '-') {
03cfe0d51499e86b1573d121337594719d9f2012Lennart Poettering log_debug_errno(r, "Failed to symlink %s to %s: %m", j, n);
03cfe0d51499e86b1573d121337594719d9f2012Lennart Poettering if (uid != UID_INVALID || gid != GID_INVALID)
03cfe0d51499e86b1573d121337594719d9f2012Lennart Poettering log_debug_errno(errno, "Failed to chown %s: %m", n);