Skip to content

Commit 0b0af0a

Browse files
committed
updating sleep to allow nil arguments
1 parent b0ce2c0 commit 0b0af0a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/rex.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module Rex
9191

9292
# Overload the Kernel.sleep() function to be thread-safe
9393
Kernel.class_eval("
94-
def sleep(seconds)
94+
def sleep(seconds=nil)
9595
Rex::ThreadSafe.sleep(seconds)
9696
end
9797
")

lib/rex/sync/thread_safe.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def self.select(rfd = nil, wfd = nil, efd = nil, t = nil)
7272
# Simulates a sleep operation by selecting on nil until a timeout period
7373
# expires.
7474
#
75-
def self.sleep(seconds)
75+
def self.sleep(seconds=nil)
7676
self.select(nil, nil, nil, seconds)
7777

7878
seconds

0 commit comments

Comments
 (0)