util: Add error handling to become_daemon()

Enterprise / Samba - Martin Schwenke [meltin.net] - 17 August 2017 05:48 EDT

Log failure and exit if fork() or setsid() fails.

Leave the logic in the non-setsid() code as it is. This is probably meant to fall through on failure of either opening /dev/tty or ioctl(). Documentation for the ioctl() failure case is far from clear.

9468d0f util: Add error handling to become_daemon()
lib/util/become_daemon.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Upstream: gitweb.samba.org


  • Share