summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relayd.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-02-08 13:32:25 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-02-08 13:32:25 +0000
commit0ae251368e20313e60a071549d04cb246ecf9d0a (patch)
tree9a87bef487bdb3c936993cb48cd01ef6a23251c3 /usr.sbin/relayd/relayd.c
parent352d740dd85eb470c920da7405b235e0849a6c80 (diff)
carefully check some return values and make lint happier. never pass
any truncated strings (table names/anchors/tags/...) to pf and the kernel. ok pyr@
Diffstat (limited to 'usr.sbin/relayd/relayd.c')
-rw-r--r--usr.sbin/relayd/relayd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index e0aa22192fe..976029c0e43 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.15 2007/02/07 13:30:17 reyk Exp $ */
+/* $OpenBSD: relayd.c,v 1.16 2007/02/08 13:32:24 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -152,8 +152,10 @@ main(int argc, char *argv[])
if (getpwnam(HOSTSTATED_USER) == NULL)
errx(1, "unknown user %s", HOSTSTATED_USER);
- if (!debug)
- daemon(1, 0);
+ if (!debug) {
+ if (daemon(1, 0) == -1)
+ err(1, "failed to daemonize");
+ }
log_info("startup");