summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/rarpd/files/1.1-daemon.patch')
-rw-r--r--net-misc/rarpd/files/1.1-daemon.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/net-misc/rarpd/files/1.1-daemon.patch b/net-misc/rarpd/files/1.1-daemon.patch
new file mode 100644
index 000000000000..7a2d68b856f8
--- /dev/null
+++ b/net-misc/rarpd/files/1.1-daemon.patch
@@ -0,0 +1,29 @@
+--- rarpd.c.orig 2003-11-03 22:10:41.000304928 -0500
++++ rarpd.c 2003-11-03 22:13:52.683164704 -0500
+@@ -429,12 +429,25 @@
+ openlog(program_name, syslogflags, LOG_LOCAL1);
+
+ if (!nofork) {
++ FILE *pidfile;
+ pid = fork();
+- if (pid > 0) exit(0);
+ if (pid < 0) {
+ syslog(LOG_ERR, "%s: fork failed: %s", program_name, strerror(errno));
+ exit(1);
+ }
++ if (pid) {
++ pidfile = fopen("/var/run/rarpd.pid", "w");
++ if (pidfile) {
++ fprintf(pidfile, "%i", pid);
++ fclose(pidfile);
++ } else
++ perror("Could not write pidfile");
++ exit(0);
++ }
++ chdir("/");
++ close(0);
++ close(1);
++ close(2);
+ }
+
+ if (ethers == NULL) ethers = _PATH_ETHERS;