Tweaked return code handling to use the usual Python method
Sapan Bhatia [Tue, 5 Mar 2013 14:19:12 +0000 (09:19 -0500)]
lxcsu

diff --git a/lxcsu b/lxcsu
index baf0e97..7a4ed1b 100644 (file)
--- a/lxcsu
+++ b/lxcsu
@@ -124,7 +124,5 @@ if (pid == 0):
     os.environ['SHELL'] = '/bin/sh'
     os.execv('/usr/sbin/capsh',exec_args)
 else:
-    (r_pid,combined)=os.waitpid(pid,0)
-    retcod=combined/256
-    sys.exit(retcod)
-    
+    _,status = os.waitpid(pid,0)
+    exit(os.WEXITSTATUS(status))