summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames <31272717+gpd-pocket-hacker@users.noreply.github.com>2020-11-09 16:34:32 +0000
committerJames <31272717+gpd-pocket-hacker@users.noreply.github.com>2020-11-09 16:40:39 +0000
commitc44cf3a3f0a73ad276c0316759fcb0d8a0d22032 (patch)
tree95cd6e8e079c49a8922c0c839b9e2d9e0434137b
parentbfac22dc79164bab10185188e12cee313ab96de9 (diff)
downloadgalaxy_tools-c44cf3a3f0a73ad276c0316759fcb0d8a0d22032.tar.gz
galaxy_tools-c44cf3a3f0a73ad276c0316759fcb0d8a0d22032.tar.bz2
galaxy_tools-c44cf3a3f0a73ad276c0316759fcb0d8a0d22032.zip
put ascii in subject of emails
-rw-r--r--email.c8
-rw-r--r--rx.c2
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 <syslog.h>
#include <fcntl.h>
#include <unistd.h>
+#include <sys/wait.h>
+
#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);
}