pkgsrc/net/openvmps/patches/patch-aa
bouyer cb6daaeec9 On NetBSD use daemon() instead of the custom code here which forgets to
close std*. Now it's possible to properly restart the daemon from a
rsh/ssh command. Bump pkgrevision.
2006-05-31 17:47:45 +00:00

37 lines
749 B
Text

$NetBSD: patch-aa,v 1.3 2006/05/31 17:47:45 bouyer Exp $
--- daemon.c.orig 2004-07-24 02:46:49.000000000 +0200
+++ daemon.c 2006-05-30 23:12:09.000000000 +0200
@@ -14,8 +14,6 @@
#define VMPS_CHECK_BSD
#endif
-extern int errno;
-
#ifdef VMPS_CHECK_BSD
#include <sys/file.h>
#include <sys/ioctl.h>
@@ -44,6 +42,15 @@
{
register int childpid;
+#ifdef __NetBSD__
+ if (daemon(0,0)) {
+ fprintf(stderr, "%s: can't daemon(): %s\n",
+ getprogname(), strerror(errno));
+ }
+#else /* !__NetBSD__ */
+#ifdef VMPS_CHECK_BSD
+ int fd;
+#endif
#ifdef SIGTTOU
signal(SIGTTOU, SIG_IGN);
@@ -91,6 +98,7 @@
if ( childpid > 0 ) exit(0);
#endif
+#endif /* !NetBSD */
errno = 0;
umask(0);