summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-04-28 16:42:55 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-04-28 16:42:55 +0000
commit114ff6636b3bb7041273bf39bb29929944d55120 (patch)
tree90e092c1604769ba505cf2adc18ba8a8af7f625d
parentd6af99f861a79474cb291fbb41e21413343a3ee9 (diff)
downloadpango-114ff6636b3bb7041273bf39bb29929944d55120.tar.gz
Wait for convert(1) to finish. Patch by Jamie Guinan.
2008-04-28 Behdad Esfahbod <behdad@gnome.org> * pango-view/viewer-main.c (main): Wait for convert(1) to finish. Patch by Jamie Guinan. svn path=/trunk/; revision=2620
-rw-r--r--ChangeLog5
-rw-r--r--pango-view/viewer-main.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c33813dc..c6c82329 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-28 Behdad Esfahbod <behdad@gnome.org>
+
+ * pango-view/viewer-main.c (main): Wait for convert(1) to finish.
+ Patch by Jamie Guinan.
+
2008-04-24 Behdad Esfahbod <behdad@gnome.org>
Part of Bug 97545 – Make pango_default_break follow Unicode TR #29
diff --git a/pango-view/viewer-main.c b/pango-view/viewer-main.c
index f3d93df4..3388e410 100644
--- a/pango-view/viewer-main.c
+++ b/pango-view/viewer-main.c
@@ -69,6 +69,7 @@ main (int argc,
else
{
FILE *stream;
+ GPid pid = 0;
if (view->write_suffix && g_str_has_suffix (opt_output, view->write_suffix))
{
@@ -86,15 +87,20 @@ main (int argc,
convert_argv[2] = opt_output;
if (!g_spawn_async_with_pipes (NULL, (gchar **)convert_argv, NULL,
+ G_SPAWN_DO_NOT_REAP_CHILD |
G_SPAWN_SEARCH_PATH |
G_SPAWN_STDOUT_TO_DEV_NULL |
G_SPAWN_STDERR_TO_DEV_NULL,
- NULL, NULL, NULL, &fd, NULL, NULL, &error))
+ NULL, NULL, &pid, &fd, NULL, NULL, &error))
fail ("When running ImageMagick 'convert' command: %s\n", error->message);
stream = fdopen (fd, "wb");
}
view->write (instance, surface, stream, width, height);
fclose (stream);
+#ifdef G_OS_UNIX
+ if (pid)
+ waitpid (pid, NULL, 0);
+#endif
}
}