# HG changeset patch # User Jun Wu # Date 1460322034 -3600 # Node ID 6e06fbee9244dcfaa75bebe848913e4ab09ad54c # Parent 39130afcce602f6230f8f5c83f3c524a60a830bb chg: server exited with code 0 without being connectable is an error Before this patch, if the server started by chg has exited with code 0 without creating a connectable unix domain socket at the specified address, chg will exit with code 0, which is not the correct behavior. It can happen, for example, CHGHG is set to /bin/true. This patch addresses the issue by checking the exit code of the server and printing a new error message if the server exited normally but cannot be reached. diff -r 39130afcce60 -r 6e06fbee9244 contrib/chg/chg.c --- a/contrib/chg/chg.c Fri Apr 08 23:33:28 2016 -0700 +++ b/contrib/chg/chg.c Sun Apr 10 22:00:34 2016 +0100 @@ -269,6 +269,9 @@ cleanup: if (WIFEXITED(pst)) { + if (WEXITSTATUS(pst) == 0) + abortmsg("could not connect to cmdserver " + "(exited with status 0)"); debugmsg("cmdserver exited with status %d", WEXITSTATUS(pst)); exit(WEXITSTATUS(pst)); } else if (WIFSIGNALED(pst)) {