[gimp] plug-ins: fix sendmail alternative.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: fix sendmail alternative.
- Date: Fri, 27 May 2016 20:09:47 +0000 (UTC)
commit 22905e717407618a2d0bf6666e53bd1d1c975e72
Author: Jehan <jehan girinstud io>
Date: Fri May 27 21:57:06 2016 +0200
plug-ins: fix sendmail alternative.
Oups! I should have retested --with-sendmail before pushing, after the
changes in commit 05f7726.
plug-ins/common/mail.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c
index a3a2248..4603bec 100644
--- a/plug-ins/common/mail.c
+++ b/plug-ins/common/mail.c
@@ -80,7 +80,7 @@ static gchar * find_extension (const gchar *filename);
static void mesg_body_callback (GtkTextBuffer *buffer,
gpointer data);
-static gchar * sendmail_content_type (const gchar *filename)
+static gchar * sendmail_content_type (const gchar *filename);
static void sendmail_create_headers (FILE *mailpipe);
static gboolean sendmail_to64 (const gchar *filename,
FILE *outfile,
@@ -292,7 +292,7 @@ send_image (const gchar *filename,
#else /* SENDMAIL */
gchar *mailcmd[3];
GPid mailpid;
- FILE *mailpipe;
+ FILE *mailpipe = NULL;
#endif
GError *error = NULL;
@@ -410,11 +410,11 @@ send_image (const gchar *filename,
if (mailpipe == NULL)
return GIMP_PDB_EXECUTION_ERROR;
- create_headers (mailpipe);
+ sendmail_create_headers (mailpipe);
fflush (mailpipe);
- if (! to64 (tmpname, mailpipe, &error))
+ if (! sendmail_to64 (tmpname, mailpipe, &error))
{
g_message ("%s", error->message);
g_error_free (error);
@@ -436,9 +436,12 @@ error:
cleanup:
/* close out the sendmail process */
#ifdef SENDMAIL
- fclose (mailpipe);
- waitpid (mailpid, NULL, 0);
- g_spawn_close_pid (mailpid);
+ if (mailpipe)
+ {
+ fclose (mailpipe);
+ waitpid (mailpid, NULL, 0);
+ g_spawn_close_pid (mailpid);
+ }
/* delete the tmpfile that was generated */
g_unlink (tmpname);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]