From: Stefan Raspl Date: Fri, 10 Mar 2017 12:40:09 +0000 (+0100) Subject: tools/kvm_stat: remove pid filter on empty input X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=be03ea3b77387db36617d71d60ee182a866fb9cd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git tools/kvm_stat: remove pid filter on empty input Improve consistency in the interactive dialogue for pid filtering by removing any filters on empty input (in addition to entering 0). Signed-off-by: Stefan Raspl Reviewed-by: Janosch Frank Reviewed-by: Marc Hartmayer Signed-off-by: Radim Krčmář --- diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat index 95ffa9a4b044..9e9eb983f6fe 100755 --- a/tools/kvm/kvm_stat/kvm_stat +++ b/tools/kvm/kvm_stat/kvm_stat @@ -991,10 +991,13 @@ class Tui(object): curses.noecho() try: - pid = int(pid) - if pid != 0 and not os.path.isdir(os.path.join('/proc/', - str(pid))): - continue + if len(pid) > 0: + pid = int(pid) + if pid != 0 and not os.path.isdir(os.path.join('/proc/', + str(pid))): + continue + else: + pid = 0 self.refresh_header(pid) self.update_pid(pid) break