chg: silently inherit server exit code
authorJun Wu <quark@fb.com>
Fri, 11 Mar 2016 02:52:06 +0000
changeset 28477 194a6cd873cd
parent 28476 e28dc6de38e7
child 28478 e6e183687545
chg: silently inherit server exit code If chgserver aborts during startup, for example, error.ParseError when parsing a config file, chg client probably just wants to exit with a same exit code without printing other unrelated text. This patch changes the text "cmdserver exited with status" from abortmsg to debugmsg and exits with a same exit code.
contrib/chg/chg.c
--- a/contrib/chg/chg.c	Sun Mar 06 03:19:08 2016 +0530
+++ b/contrib/chg/chg.c	Fri Mar 11 02:52:06 2016 +0000
@@ -252,7 +252,8 @@
 
 cleanup:
 	if (WIFEXITED(pst)) {
-		abortmsg("cmdserver exited with status %d", WEXITSTATUS(pst));
+		debugmsg("cmdserver exited with status %d", WEXITSTATUS(pst));
+		exit(WEXITSTATUS(pst));
 	} else if (WIFSIGNALED(pst)) {
 		abortmsg("cmdserver killed by signal %d", WTERMSIG(pst));
 	} else {