Commit 2febc297 authored by Sasha Goldshtein's avatar Sasha Goldshtein

trace: Exit with nonzero return code on error

parent f7ab4431
...@@ -691,10 +691,13 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec' ...@@ -691,10 +691,13 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
self._attach_probes() self._attach_probes()
self._main_loop() self._main_loop()
except: except:
exc_info = sys.exc_info()
sys_exit = exc_info[0] is SystemExit
if self.args.verbose: if self.args.verbose:
traceback.print_exc() traceback.print_exc()
elif sys.exc_info()[0] is not SystemExit: elif not sys_exit:
print(sys.exc_info()[1]) print(exc_info[1])
exit(0 if sys_exit else 1)
if __name__ == "__main__": if __name__ == "__main__":
Tool().run() Tool().run()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment