diff options
author | James <31272717+gpd-pocket-hacker@users.noreply.github.com> | 2020-11-09 16:34:32 +0000 |
---|---|---|
committer | James <31272717+gpd-pocket-hacker@users.noreply.github.com> | 2020-11-09 16:40:39 +0000 |
commit | c44cf3a3f0a73ad276c0316759fcb0d8a0d22032 (patch) | |
tree | 95cd6e8e079c49a8922c0c839b9e2d9e0434137b | |
parent | bfac22dc79164bab10185188e12cee313ab96de9 (diff) | |
download | galaxy_sia-c44cf3a3f0a73ad276c0316759fcb0d8a0d22032.tar.gz galaxy_sia-c44cf3a3f0a73ad276c0316759fcb0d8a0d22032.tar.bz2 galaxy_sia-c44cf3a3f0a73ad276c0316759fcb0d8a0d22032.zip |
put ascii in subject of emails
-rw-r--r-- | email.c | 8 | ||||
-rw-r--r-- | rx.c | 2 |
2 files changed, 8 insertions, 2 deletions
@@ -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;; } @@ -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); } |