commit 8ac071ae8da1618b1c6d4e20cef7f7a0dd8a511c
parent 2a5f10583b98cbf9aa094a244c021c8fee9e905e
Author: grunfink <grunfink@noreply.codeberg.org>
Date: Thu, 1 Dec 2022 18:40:49 +0000
Merge pull request 'this is actually a pipe not a file, it should be closed as a pipe' (#6) from themusicgod1/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/6
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/activitypub.c b/activitypub.c
@@ -1017,10 +1017,10 @@ void process_queue(snac *snac)
FILE *f;
int ok = 0;
- if ((f = popen("/usr/sbin/sendmail -t", "w")) != NULL) {
+ f = popen("/usr/sbin/sendmail -t", "w");
+ if (f) {
fprintf(f, "%s\n", msg);
-
- if (fclose(f) != EOF)
+ if (pclose(f) != EOF) //this is a pipe stream not just a file
ok = 1;
}