summarylogtreecommitdiffstats
path: root/ax25.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ax25.patch')
-rw-r--r--ax25.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/ax25.patch b/ax25.patch
new file mode 100644
index 00000000000..359d7119072
--- /dev/null
+++ b/ax25.patch
@@ -0,0 +1,59 @@
+--- ax25/ax25d.c
++++ ax25/ax25d.c
+@@ -307,6 +307,17 @@ int main(int argc, char *argv[])
+ syslog(LOG_INFO, "starting");
+ }
+
++ /* gjcp - write PID file */
++ // FIXME - should be configurable
++ FILE *f = fopen("/var/run/ax25d.pid", "w");
++
++ if (f == NULL) {
++ syslog(LOG_WARNING, "Couldn't create PID file /var/run/ax25d.pid: %s", strerror(errno));
++ } else {
++ fprintf(f, "%ld\n", (long) getpid());
++ fclose(f);
++ }
++
+ act.sa_handler = SignalHUP;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+@@ -643,7 +654,8 @@ static void SignalTERM(int code)
+ syslog(LOG_INFO, "terminating on SIGTERM\n");
+ closelog();
+ }
+-
++ // FIXME - hardcoded path
++ unlink("/var/run/ax25d.pid");
+ exit(0);
+ }
+
+--- ax25/mheardd.c
++++ ax25/mheardd.c
+@@ -98,7 +98,7 @@ static void terminate(int sig)
+ syslog(LOG_INFO, "terminating on SIGTERM\n");
+ closelog();
+ }
+-
++ unlink("/var/run/mheardd.pid");
+ exit(0);
+ }
+
+@@ -210,6 +210,17 @@ int main(int argc, char **argv)
+ syslog(LOG_INFO, "starting");
+ }
+
++ /* gjcp - write PID file */
++ // FIXME - should be configurable
++ FILE *f = fopen("/var/run/mheardd.pid", "w");
++
++ if (f == NULL) {
++ syslog(LOG_WARNING, "Couldn't create PID file /var/run/mheardd.pid: %s", strerror(errno));
++ } else {
++ fprintf(f, "%ld\n", (long) getpid());
++ fclose(f);
++ }
++
+ for (;;) {
+ asize = sizeof(sa);
+