From a7c329971f4dd3e2a90431268be616123361f085 Mon Sep 17 00:00:00 2001 From: Alexey Avramov Date: Sun, 15 Mar 2020 22:59:43 +0900 Subject: [PATCH] Fix PermissionError with hidepid=1 #88 --- nohang/nohang | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nohang/nohang b/nohang/nohang index d22e021..277f371 100755 --- a/nohang/nohang +++ b/nohang/nohang @@ -25,7 +25,8 @@ def check_permissions(): try: rline1('/proc/1/oom_score') except Exception as e: - print('WARNING: {}'.format(e)) + print('ERROR: {}'.format(e)) + exit(1) def memload(): @@ -1535,6 +1536,8 @@ def is_alive(pid): return False except NotADirectoryError: return False + except PermissionError: + return False def alive_pid_list():