Sat Apr 11 12:54:41 2015 UTC ()
Define the expansion of the VFORK macro, not the symbol `VFORK'.

Fixes hijacking processes that vfork and exec.  Symptom was the child
would spin with read/EAGAIN <-> kevent/EBADF because the inheritance
mechanism relied on setting the holyfd to -1 on fork...which didn't
happen if we didn't hijack vfork.

ok pooka@


(riastradh)
diff -r1.116 -r1.117 src/lib/librumphijack/hijack.c

cvs diff -r1.116 -r1.117 src/lib/librumphijack/hijack.c (expand / switch to context diff)
--- src/lib/librumphijack/hijack.c 2015/03/05 00:26:17 1.116
+++ src/lib/librumphijack/hijack.c 2015/04/11 12:54:41 1.117
@@ -1,4 +1,4 @@
-/*      $NetBSD: hijack.c,v 1.116 2015/03/05 00:26:17 pooka Exp $	*/
+/*      $NetBSD: hijack.c,v 1.117 2015/04/11 12:54:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include <rump/rumpuser_port.h>
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.116 2015/03/05 00:26:17 pooka Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.117 2015/04/11 12:54:41 riastradh Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1721,7 +1721,8 @@
 }
 #ifdef VFORK
 /* we do not have the luxury of not requiring a stackframe */
-__strong_alias(VFORK,fork);
+#define	__strong_alias_macro(m, f)	__strong_alias(m, f)
+__strong_alias_macro(VFORK,fork);
 #endif
 
 int