fix(case): silence vanished stat opens per mos-1337 N5
This commit is contained in:
1 parent
3b90428021
commit
537ce2dd4a
4 files changed
+22
-3
No files matched your search
@@ -124,7 +124,7 @@ child="" timer="" verified=0
|
||||
stat_fields() {
|
||||
local pid="$1" raw="" rest
|
||||
# EOF is expected: stat has no NUL. Decide on content, not read's status.
|
||||
IFS= read -r -d '' raw < "/proc/$pid/stat" 2>/dev/null || :
|
||||
IFS= read -r -d '' raw 2>/dev/null < "/proc/$pid/stat" || :
|
||||
[ -n "$raw" ] || { [ -e "/proc/$pid/stat" ] && return 1; return 3; }
|
||||
rest="${raw##*) }"
|
||||
[ "$rest" != "$raw" ] || return 1
|
||||
|
||||
@@ -163,7 +163,7 @@ child="" timer="" verified=0
|
||||
stat_fields() {
|
||||
local pid="$1" raw="" rest
|
||||
# EOF is expected: stat has no NUL. Decide on content, not read's status.
|
||||
IFS= read -r -d '' raw < "/proc/$pid/stat" 2>/dev/null || :
|
||||
IFS= read -r -d '' raw 2>/dev/null < "/proc/$pid/stat" || :
|
||||
[ -n "$raw" ] || { [ -e "/proc/$pid/stat" ] && return 1; return 3; }
|
||||
rest="${raw##*) }"
|
||||
[ "$rest" != "$raw" ] || return 1
|
||||
|
||||
Reference in new issue
Block a user