Просмотр исходного кода

this is actually a pipe not a file, it should be closed as a pipe

Anonymous 3 лет назад
Родитель
Сommit
893634027f
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      activitypub.c

+ 3 - 3
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;
             }