nommu systems lack a fork() function, so add a NO_FORK flag to control
its usage. We don't lose a ton of functionality in doing so, and on an
embedded system, this is OK.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Neil Brown <neilb@suse.de>
endif
endif
+# For no-mmu systems, we have to disable the fork() functions.
+ifneq ($(NO_FORK),)
+CPPFLAGS += -DNO_FORK
+endif
+
ifeq ($(PREFIX),)
PREFIX = /usr
endif
Some make variable can be used to control compilation.
+ NO_FORK= if non-empty, don't use fork (good for nommu systems)
NO_PIE= if non-empty, don't build portmap as a PIE
NO_TCP_WRAPPER= if non-empty, don't use tcp_wrappers
USE_DNS= if set, tcp_wrappers can check peers based on hostname
* getrpcbynumber() or syslog() does its thing.
*/
- if (fork() == 0) {
-
+#ifndef NO_FORK
+ if (fork() == 0)
+#endif
+ {
/* Try to map program number to name. */
if (prognum == 0) {
if ((pml = find_service(a.rmt_prog, a.rmt_vers,
(u_long)IPPROTO_UDP)) == NULL)
return;
+#ifndef NO_FORK
/*
* fork a child to do the work. Parent immediately returns.
* Child exits upon completion.
a.rmt_prog);
return;
}
+#endif
port = pml->pml_map.pm_port;
get_myaddress(&me);
me.sin_port = htons(port);
clnt_destroy(client);
}
(void)close(so);
+#ifndef NO_FORK
exit(0);
+#endif
}
#ifndef IGNORE_SIGCHLD /* Lionel Cons <cons@dxcern.cern.ch> */