mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 12:02:47 -05:00
Clean up Unix Pageant's setup and teardown.
I've moved the listening socket setup back to before the lifetime preparations, so in particular we find out that we couldn't bind to the socket _before_ we fork. The only part that really needed to come after lifetime setup was the logging setup, so that's now a separate function called later. Also, the random exit(0)s in silly places like x11_closing have turned into setting a time_to_die flag, so that all clean exits funnel back to the end of main() which at least tries to tidy up a bit afterwards. (Finally, fixed a small bug in testing the return value of waitpid(), which only showed up once we didn't exit(0) after the first wait. Ahem.)
This commit is contained in:
@ -76,10 +76,12 @@ void keylist_update(void);
|
||||
* protocol. Call pageant_listener_new() to set up a state; then
|
||||
* create a socket using the returned pointer as a Plug; then call
|
||||
* pageant_listener_got_socket() to give the listening state its own
|
||||
* socket pointer.
|
||||
* socket pointer. Also, provide a logging function later if you want
|
||||
* to.
|
||||
*/
|
||||
struct pageant_listen_state;
|
||||
struct pageant_listen_state *pageant_listener_new(void *logctx,
|
||||
pageant_logfn_t logfn);
|
||||
struct pageant_listen_state *pageant_listener_new(void);
|
||||
void pageant_listener_got_socket(struct pageant_listen_state *pl, Socket sock);
|
||||
void pageant_listener_set_logfn(struct pageant_listen_state *pl,
|
||||
void *logctx, pageant_logfn_t logfn);
|
||||
void pageant_listener_free(struct pageant_listen_state *pl);
|
||||
|
Reference in New Issue
Block a user