aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2016-02-01 07:09:45 +0100
committerLukas Nykryn <lnykryn@redhat.com>2016-02-01 07:09:45 +0100
commit557d4f4a7127b51652e4f5f4349ac4d8d7132854 (patch)
tree23e08c56059d68fe1a7a00da27f1af055f714c66 /rc.d/init.d/functions
parent67f73458333fe114003ec262241cd59334c51fdd (diff)
downloadinitscripts-557d4f4a7127b51652e4f5f4349ac4d8d7132854.tar
initscripts-557d4f4a7127b51652e4f5f4349ac4d8d7132854.tar.gz
initscripts-557d4f4a7127b51652e4f5f4349ac4d8d7132854.tar.bz2
initscripts-557d4f4a7127b51652e4f5f4349ac4d8d7132854.tar.xz
initscripts-557d4f4a7127b51652e4f5f4349ac4d8d7132854.zip
init.d/functions: fix a possible race between checking file and reading it
Diffstat (limited to 'rc.d/init.d/functions')
-rw-r--r--rc.d/init.d/functions4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 98738193..04ce2a71 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -91,8 +91,8 @@ __kill_pids_term_kill_checkpids() {
local stime=
for pid in $pids ; do
- [ ! -e "/proc/$pid" ] && continue
- read -r line < "/proc/$pid/stat" 2> /dev/null
+ [ -e "/proc/$pid" ] || continue
+ read -r line < "/proc/$pid/stat" 2> /dev/null || continue
stat=($line)
stime=${stat[21]}