ソースを参照

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
grunfink 3 年 前
コミット
8ac071ae8d
1 ファイル変更3 行追加3 行削除
  1. 3 3
      activitypub.c

+ 3 - 3
activitypub.c

@@ -1017,10 +1017,10 @@ void process_queue(snac *snac)
             FILE *f;
             FILE *f;
             int ok = 0;
             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);
                 fprintf(f, "%s\n", msg);
-
-                if (fclose(f) != EOF)
+                if (pclose(f) != EOF) //this is a pipe stream not just a file
                     ok = 1;
                     ok = 1;
             }
             }