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
This commit is contained in:
Dirk Sondermann 2013-07-27 10:53:32 -05:00 committed by William Hubbs
parent e942e88b8c
commit e90dcf39dd

View File

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