dtas-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] readahead: avoid Array#compact and Array#max on `false'


From: Eric Wong
Subject: [PATCH] readahead: avoid Array#compact and Array#max on `false'
Date: Wed, 13 Nov 2019 03:00:37 +0000

seek_to_cur_pos needs to return `nil', not `false' on
dead processes when monitoring processes for readahead.
---
 bin/dtas-readahead | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/dtas-readahead b/bin/dtas-readahead
index 93ab8c9..99ba65c 100755
--- a/bin/dtas-readahead
+++ b/bin/dtas-readahead
@@ -57,7 +57,7 @@ def seek_to_cur_pos(cur_pid, fp)
       end
     end
   rescue Errno::ENOENT => e # race, process is dead
-    return false
+    return nil
   rescue => e
     warn "error reading FDs from for PID:#{cur_pid}: #{e.message}"
   end
@@ -71,7 +71,7 @@ def seek_to_cur_pos(cur_pid, fp)
   end
   pos
 rescue Errno::ENOENT => e # race, process is dead
-  return false
+  return nil
 end
 
 def children_of(ppid)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]