main: quit cleanly on SIGTERM, SIGINT, and SIGHUP

Logging out or shutting down sends SIGTERM, which killed parcel at once: changes still on their way to the server and the drafts' last edits were lost, and the mail cache kept its last poll's state, so the next run asked the server again and could notify the user of mail already seen. A handler for the three signals writes to a pipe siv's loop watches, which quits the app the way closing the window does, and the sessions finish: they send what is queued and save. A signalfd would have needed the signals blocked, and the programs parcel starts would inherit the mask. The compositor may go before parcel does, so an error from the run, or from dispatching while the sessions finish, no longer skips saving.


Author rockorager.dev
Date Commit Parent 2054e0a4
+57 -7
3 changed files
+57 -7
3 changed files