Skip to content

Commit

Permalink
sighandler() should take 2 arguments
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Signed-off-by: Isaac Huang <he.huang@intel.com>
Closes #2179
  • Loading branch information
huangheintel authored and behlendorf committed Mar 20, 2014
1 parent d9119bd commit 312f82c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/arcstat/arcstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import copy

from decimal import Decimal
from signal import signal, SIGINT
from signal import signal, SIGINT, SIG_DFL

cols = {
# HDR: [Size, Scale, Description]
Expand Down Expand Up @@ -413,10 +413,6 @@ def calculate():
v["l2bytes"] = d["l2_read_bytes"] / sint


def sighandler():
sys.exit(0)


def main():
global sint
global count
Expand All @@ -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()
Expand Down

0 comments on commit 312f82c

Please sign in to comment.