Module: sip-router Branch: master Commit: 83e91df1441b671b358efa0f1919e8ecb122cebf URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=83e91df1...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Thu Aug 19 20:03:54 2010 +0200
core: daemon status/pipe fixes & interface changes
- moved most of the daemon status stuff to daemonize.[ch]. - nicer interface (e.g. daemon_status_send(code)) - send/read only 1 byte which will be used as exit code - send an error status on error (fixes "Main process exited before writing to pipe" error message) - disabled the timeout. Not needed (now a status is sent always and even an unlikely process crash before sending it is detected via the read() failure) and very hard to find a good value (some setups start very slow). - close the pipe "send" fd in processes not needing it - attempt to send back status only if dont_daemonize is not set (not only if dont_fork==0, it is possible to have forking enabled, but daemonize disabled: ser -DD) - BSDed daemonize.[ch] and pt.[ch]
---
daemonize.c | 206 +++++++++++++++++++++++++++++++++++++++++++++++++++------- daemonize.h | 36 ++++++----- main.c | 74 ++++++--------------- pt.c | 43 +++++-------- pt.h | 35 ++++------ 5 files changed, 253 insertions(+), 141 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=83e9...