From 7f14931def91afb3c6533df4e6ff1b6fa17d713c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 29 Nov 2015 10:43:58 +0100 Subject: typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/examples/daemon-dependencies/cleanup.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 doc/examples/daemon-dependencies/cleanup.c (limited to 'doc/examples/daemon-dependencies/cleanup.c') diff --git a/doc/examples/daemon-dependencies/cleanup.c b/doc/examples/daemon-dependencies/cleanup.c new file mode 100644 index 0000000..f9ead6d --- /dev/null +++ b/doc/examples/daemon-dependencies/cleanup.c @@ -0,0 +1,25 @@ +#include +#include +#include + +#define t(stmt) if (stmt) goto fail + + + +int +main() +{ + char *bus_address = getenv("BUS_INIT"); + if (!bus_address || !*bus_address) { + fprintf(stderr, "$BUS_INIT has not been set, its export statement " + "should have been printed in bold red by ./init\n"); + return 1; + } + t(bus_unlink(bus_address)); + return 0; + +fail: + perror("cleanup"); + return 1; +} + -- cgit v1.2.3-70-g09d2