diff --git a/Tools/Makefile.postamble b/Tools/Makefile.postamble index 13c65808b..d6733293d 100644 --- a/Tools/Makefile.postamble +++ b/Tools/Makefile.postamble @@ -20,6 +20,7 @@ # Things to do after installing after-install:: $(INSTALL) -m 05755 $(GNUSTEP_OBJ_DIR)/gdomap $(GNUSTEP_INSTALLATION_DIR)/Tools/$(GNUSTEP_TARGET_DIR) + $(INSTALL) -m 05755 $(GNUSTEP_OBJ_DIR)/gdnc $(GNUSTEP_INSTALLATION_DIR)/Tools/$(GNUSTEP_TARGET_DIR) # Things to do before uninstalling # before-uninstall:: diff --git a/Tools/gdnc.m b/Tools/gdnc.m index 492304b2c..49e84f017 100644 --- a/Tools/gdnc.m +++ b/Tools/gdnc.m @@ -744,6 +744,27 @@ main() GDNCServer *server; NSAutoreleasePool *pool; + switch (fork()) + { + case -1: + fprintf(stderr, "gdnc - fork failed - bye.\n"); + exit(1); + + case 0: + /* + * Try to run in background. + */ +#ifdef NeXT + setpgrp(0, getpid()); +#else + setsid(); +#endif + break; + + default: + exit(0); + } + pool = [NSAutoreleasePool new]; server = [GDNCServer new]; [pool release];