comparison contrib/chg/chg.c @ 28555:1435a8e9b5fe

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.
author Jun Wu <quark@fb.com>
date Mon, 14 Mar 2016 15:05:25 +0000
parents aa082a8125da
children baa073200ba2
comparison
equal deleted inserted replaced
28554:fa3438548b3d 28555:1435a8e9b5fe
292 if (pid < 0) 292 if (pid < 0)
293 abortmsg("failed to fork cmdserver process"); 293 abortmsg("failed to fork cmdserver process");
294 if (pid == 0) { 294 if (pid == 0) {
295 /* do not leak lockfd to hg */ 295 /* do not leak lockfd to hg */
296 close(opts->lockfd); 296 close(opts->lockfd);
297 /* bypass uisetup() of pager extension */
298 int nullfd = open("/dev/null", O_WRONLY);
299 if (nullfd >= 0) {
300 dup2(nullfd, fileno(stdout));
301 close(nullfd);
302 }
303 execcmdserver(opts); 297 execcmdserver(opts);
304 } else { 298 } else {
305 hgc = retryconnectcmdserver(opts, pid); 299 hgc = retryconnectcmdserver(opts, pid);
306 } 300 }
307 301