summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/marker/utils/syncdaemon/gsyncd.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py
index 2ce11a8aa39..140a8283d6c 100644
--- a/xlators/features/marker/utils/syncdaemon/gsyncd.py
+++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py
@@ -168,10 +168,13 @@ def main():
try:
main_i()
except:
- exc = sys.exc_info()[0]
- if exc != SystemExit:
+ exc = sys.exc_info()[1]
+ if isinstance(exc, SystemExit):
+ exval = exc.code or 0
+ raise
+ else:
logging.exception("FAIL: ")
- sys.stderr.write("failed with %s.\n" % exc.__name__)
+ sys.stderr.write("failed with %s.\n" % type(exc).__name__)
exval = 1
sys.exit(exval)
finally: