[evolution-data-server/gnome-40] I#346 - Camel: "Pipe to program" filter does not work



commit 12db8246cb9184c22500cb030395974961370eae
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 11 08:33:50 2021 +0200

    I#346 - Camel: "Pipe to program" filter does not work
    
    Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/346

 src/camel/camel-filter-driver.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/camel/camel-filter-driver.c b/src/camel/camel-filter-driver.c
index 74b7829ad..f90ba4d64 100644
--- a/src/camel/camel-filter-driver.c
+++ b/src/camel/camel-filter-driver.c
@@ -1126,10 +1126,11 @@ pipe_to_system (struct _CamelSExp *f,
                goto wait;
        }
 
-       if (camel_stream_flush (stream, NULL, NULL) == -1) {
-               g_object_unref (stream);
-               close (pipe_from_child);
-               goto wait;
+       if (camel_stream_flush (stream, NULL, &error) == -1) {
+               if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT))
+                       g_warning ("%s: Failed to flush output stream: %s", G_STRFUNC, error->message);
+               /* Ignore flush errors, it can be due to calling fsync() on the pipe */
+               g_clear_error (&error);
        }
 
        g_object_unref (stream);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]