diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2017-10-23 23:20:31 +0300 |
---|---|---|
committer | Dee'Kej <deekej@linuxmail.org> | 2017-10-30 17:05:05 +0100 |
commit | 9170aa51fd4e8336cc34db3a1aa29989a024b50c (patch) | |
tree | c2aa704e664034cd5f80f3a943c10e64b9386d66 /rc.d | |
parent | 5829c811dd082ac046846bb932d9d14fbc777c17 (diff) | |
download | initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar.gz initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar.bz2 initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar.xz initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.zip |
Avoid some unnecessary stat calls
Diffstat (limited to 'rc.d')
-rw-r--r-- | rc.d/init.d/functions | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 63686737..2e3da964 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -59,7 +59,7 @@ systemctl_redirect () { [ -z "${COLUMNS:-}" ] && COLUMNS=80 if [ -z "${CONSOLETYPE:-}" ]; then - if [ -c "/dev/stderr" -a -r "/dev/stderr" ]; then + if [ -c "/dev/stderr" ] && [ -r "/dev/stderr" ]; then CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)" else CONSOLETYPE="serial" @@ -194,7 +194,7 @@ __pids_var_run() { local pid_dir=$(/usr/bin/dirname $pid_file > /dev/null) local binary=$3 - [ -d "$pid_dir" -a ! -r "$pid_dir" ] && return 4 + [ -d "$pid_dir" ] && [ ! -r "$pid_dir" ] && return 4 pid= if [ -f "$pid_file" ] ; then |