contrib/chg/chg.c
changeset 28555 1435a8e9b5fe
parent 28535 aa082a8125da
child 28605 baa073200ba2
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