[gegl] Check return value of system()
- From: Mukund Sivaraman <muks src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Check return value of system()
- Date: Thu, 29 Jul 2010 12:14:46 +0000 (UTC)
commit 6992a09e34ffc0e4de5290dc90427a1e8e5cec20
Author: Mukund Sivaraman <muks banu com>
Date: Thu Jul 29 17:44:15 2010 +0530
Check return value of system()
gegl/gegl-dot.c | 3 ++-
operations/common/introspect.c | 3 ++-
operations/common/magick-load.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gegl/gegl-dot.c b/gegl/gegl-dot.c
index 6d98af4..181e721 100644
--- a/gegl/gegl-dot.c
+++ b/gegl/gegl-dot.c
@@ -346,5 +346,6 @@ gegl_dot_node_to_png (GeglNode *node,
/* Create a png from it */
dot_cmd = g_strdup_printf ("dot -o %s -Tpng %s", png_path, dot_filename);
- system (dot_cmd);
+ if (system (dot_cmd) == -1)
+ g_warning ("Error executing GraphViz dot program");
}
diff --git a/operations/common/introspect.c b/operations/common/introspect.c
index 7ece8c3..6b67d6b 100644
--- a/operations/common/introspect.c
+++ b/operations/common/introspect.c
@@ -59,7 +59,8 @@ gegl_introspect_load_cache (GeglChantO *op_introspect)
/* Process the .dot to a .png */
dot_cmd = g_strdup_printf ("dot -o %s -Tpng %s", png_filename, dot_filename);
- system (dot_cmd);
+ if (system (dot_cmd) == -1)
+ g_warning ("Error executing GraphViz dot program");
/* Create a graph that loads the png into a GeglBuffer and process
* it
diff --git a/operations/common/magick-load.c b/operations/common/magick-load.c
index c6ae9aa..c0144a3 100644
--- a/operations/common/magick-load.c
+++ b/operations/common/magick-load.c
@@ -50,7 +50,8 @@ load_cache (GeglChantO *op_magick_load)
filename = g_build_filename (g_get_tmp_dir (), "gegl-magick.png", NULL);
cmd = g_strdup_printf ("convert \"%s\"'[0]' \"%s\"",
op_magick_load->path, filename);
- system (cmd);
+ if (system (cmd) == -1)
+ g_warning ("Error executing ImageMagick convert program");
graph = gegl_graph (sink=gegl_node ("gegl:buffer-sink", "buffer", &newbuf, NULL,
gegl_node ("gegl:png-load", "path", filename, NULL)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]