From c44cf3a3f0a73ad276c0316759fcb0d8a0d22032 Mon Sep 17 00:00:00 2001 From: James <31272717+gpd-pocket-hacker@users.noreply.github.com> Date: Mon, 9 Nov 2020 16:34:32 +0000 Subject: put ascii in subject of emails --- email.c | 8 +++++++- rx.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/email.c b/email.c index 31c22b8..0ee47ff 100644 --- a/email.c +++ b/email.c @@ -5,6 +5,8 @@ #include #include #include +#include + #include "email.h" @@ -12,6 +14,9 @@ static int daemonish (int nochdir, int noclose) { + pid_t pid; + int status; + if (!nochdir && chdir ("/")) return -1; @@ -28,7 +33,7 @@ static int daemonish (int nochdir, int noclose) if (failed) return -1; } - switch (fork()) { + switch ((pid = fork())) { case 0: break; @@ -36,6 +41,7 @@ static int daemonish (int nochdir, int noclose) return -1; default: + waitpid (pid, &status, 0); return 1;; } diff --git a/rx.c b/rx.c index 2087f99..427dcd3 100644 --- a/rx.c +++ b/rx.c @@ -26,7 +26,7 @@ static void msg (char *account, char *event, char *ascii, int log, const char *e if (strstr (body, "HEARTBT")) return; - snprintf (subject, sizeof (subject) - 1, "Galaxy SIA from %s", account); + snprintf (subject, sizeof (subject) - 1, "Galaxy SIA: %s", ascii); send_email (email, subject, body); } -- cgit v1.2.3