From e90dcf39dd3f3658a7d9804e73d0442ae6c7935c Mon Sep 17 00:00:00 2001 From: Dirk Sondermann Date: Sat, 27 Jul 2013 10:53:32 -0500 Subject: tmpfiles: do not signal an error if device nodes already exist X-Gentoo-Bug: 478336 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=478336 --- sh/tmpfiles.sh.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in index 22d5f1f..b59f4cb 100755 --- a/sh/tmpfiles.sh.in +++ b/sh/tmpfiles.sh.in @@ -54,17 +54,19 @@ relabel() { _b() { # Create a block device node if it doesn't exist yet local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - [ ! -e "$path" ] && \ - dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:} && \ + if [ ! -e "$path" ]; then + dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:} dryrun_or_real chown $uid:$gid $path + fi } _c() { # Create a character device node if it doesn't exist yet local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - [ ! -e "$path" ] && \ - dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:} && \ + if [ ! -e "$path" ]; then + dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:} dryrun_or_real chown $uid:$gid $path + fi } -- cgit v1.2.3