diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-31 07:38:15 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-31 07:42:46 +0200 |
commit | 38dfd6da00870e5a8f1e59258f351d295599720f (patch) | |
tree | 81da931a809d410ca9902c3207a5918359beb31f /src/fastd.h | |
parent | 1d81d51e1e5e9db6c493ae2fe17280627fff15a6 (diff) | |
download | fastd-38dfd6da00870e5a8f1e59258f351d295599720f.tar fastd-38dfd6da00870e5a8f1e59258f351d295599720f.zip |
More signal handling fixes
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fastd.h b/src/fastd.h index f69f2f8..eeb2d3d 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -292,6 +292,11 @@ struct fastd_string_stack { extern fastd_context_t ctx; extern fastd_config_t conf; +extern volatile bool fastd_sig_hup; +extern volatile bool fastd_sig_terminate; +extern volatile bool fastd_sig_dump; +extern volatile bool fastd_sig_chld; + void fastd_send(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer, size_t stat_size); void fastd_send_handshake(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer); @@ -371,6 +376,11 @@ static inline size_t alignto(size_t l, size_t a) { return block_count(l, a)*a; } +/** Returns true if any unhandled signal in currently queued */ +static inline bool fastd_signalled(void) { + return (fastd_sig_hup || fastd_sig_terminate || fastd_sig_dump || fastd_sig_chld); +} + /** Returns the maximum payload size \em fastd is configured to transport */ static inline size_t fastd_max_payload(void) { switch (conf.mode) { |