summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorIsaac Huang <[email protected]>2014-03-11 17:05:46 -0600
committerBrian Behlendorf <[email protected]>2014-03-20 11:03:46 -0700
commit312f82ce65f37ed60f440194623fe38cdb1f601d (patch)
tree4be699084ddba70eaf2b1a59756011df6ed05fe6 /cmd
parentd9119bd66df789cbd43d0f6aef4cd43b6baba58c (diff)
sighandler() should take 2 arguments
Stopping arcstat.py with ^C always ends up with error: TypeError: sighandler() takes no arguments (2 given) Since no special signal handling was done in sighandler(), it's simpler to just set SIGINT handler to SIG_DFL, which terminates the script. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Isaac Huang <[email protected]> Closes #2179
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/arcstat/arcstat.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/cmd/arcstat/arcstat.py b/cmd/arcstat/arcstat.py
index 5a0912853..ba792358c 100755
--- a/cmd/arcstat/arcstat.py
+++ b/cmd/arcstat/arcstat.py
@@ -51,7 +51,7 @@ import re
import copy
from decimal import Decimal
-from signal import signal, SIGINT
+from signal import signal, SIGINT, SIG_DFL
cols = {
# HDR: [Size, Scale, Description]
@@ -413,10 +413,6 @@ def calculate():
v["l2bytes"] = d["l2_read_bytes"] / sint
-def sighandler():
- sys.exit(0)
-
-
def main():
global sint
global count
@@ -429,7 +425,7 @@ def main():
if count > 0:
count_flag = 1
- signal(SIGINT, sighandler)
+ signal(SIGINT, SIG_DFL)
while True:
if i == 0:
print_header()