From 557d4f4a7127b51652e4f5f4349ac4d8d7132854 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Mon, 1 Feb 2016 07:09:45 +0100 Subject: init.d/functions: fix a possible race between checking file and reading it --- rc.d/init.d/functions | 4 ++-- 1 file 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]} -- cgit v1.2.1