chg: do not redirect stdout to /dev/null
authorJun Wu <quark@fb.com>
Mon, 14 Mar 2016 15:05:25 +0000
changeset 28555 1435a8e9b5fe
parent 28554 fa3438548b3d
child 28556 0706d60d070f
chg: do not redirect stdout to /dev/null Redirecting stdout to /dev/null has unwanted side effects, namely ui.write will stop working. This patch removes the redirection code and helps chg to pass test-bad-extension.t.
contrib/chg/chg.c
--- a/contrib/chg/chg.c	Mon Mar 14 15:03:19 2016 +0000
+++ b/contrib/chg/chg.c	Mon Mar 14 15:05:25 2016 +0000
@@ -294,12 +294,6 @@
 	if (pid == 0) {
 		/* do not leak lockfd to hg */
 		close(opts->lockfd);
-		/* bypass uisetup() of pager extension */
-		int nullfd = open("/dev/null", O_WRONLY);
-		if (nullfd >= 0) {
-			dup2(nullfd, fileno(stdout));
-			close(nullfd);
-		}
 		execcmdserver(opts);
 	} else {
 		hgc = retryconnectcmdserver(opts, pid);