From 2c99851181a652358aa3ca58ef38c57e46ae02e4 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 12 Apr 2006 18:09:26 +0000 Subject: - patch from Denis Vlasenko to add and use bb_xdaemon() --- libbb/bb_xdaemon.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libbb/bb_xdaemon.c (limited to 'libbb/bb_xdaemon.c') diff --git a/libbb/bb_xdaemon.c b/libbb/bb_xdaemon.c new file mode 100644 index 000000000..a40f4f993 --- /dev/null +++ b/libbb/bb_xdaemon.c @@ -0,0 +1,17 @@ +/* vi: set sw=4 ts=4: */ +/* + * bb_xdaemon.c - a daemon() which dies on failure with error message + * + * Copyright (C) 2006 Denis Vlasenko + * + * Licensed under LGPL, see file docs/lesser.txt in this tarball for details. + */ +#include +#include "libbb.h" + +void bb_xdaemon(int nochdir, int noclose) +{ + if (daemon(nochdir, noclose)) + bb_perror_msg_and_die("daemon"); +} + -- cgit v1.2.3