diff rust/chg/src/uihandler.rs @ 40120:e70b616a077b

rust-chg: remove SIGCHLD handler which won't work in oxidized chg Since pager is managed by the Rust part, the C code doesn't know the pager pid. I could make the Rust part teach the pid to C, but still installing SIGCHLD handler seems horrible idea since we no longer use handcrafted low-level process management functions. Instead, I'm thinking of adding async handler to send SIGPIPE at the exit of the pager.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 24 Sep 2018 22:19:49 +0900
parents a9c5fc436fd5
children ce088b38f92b
line wrap: on
line diff
--- a/rust/chg/src/uihandler.rs	Mon Sep 24 22:04:57 2018 +0900
+++ b/rust/chg/src/uihandler.rs	Mon Sep 24 22:19:49 2018 +0900
@@ -53,6 +53,10 @@
             .spawn_async()?;
         let pin = pager.stdin().take().unwrap();
         procutil::set_blocking_fd(pin.as_raw_fd())?;
+        // TODO: if pager exits, notify the server with SIGPIPE immediately.
+        // otherwise the server won't get SIGPIPE if it does not write
+        // anything. (issue5278)
+        // kill(peerpid, SIGPIPE);
         tokio::spawn(pager.map(|_| ()).map_err(|_| ()));  // just ignore errors
         Ok((self, pin))
     }