diff --git a/plug-ins/common/compressor.c b/plug-ins/common/compressor.c index 12df23b4ca..60ea376f6b 100644 --- a/plug-ins/common/compressor.c +++ b/plug-ins/common/compressor.c @@ -287,7 +287,10 @@ save_image (char *filename, else if (pid == 0) { - f = fopen(filename,"w"); + if (!(f = fopen(filename,"w"))){ + g_warning("gz: fopen failed: %s\n", g_strerror(errno)); + _exit(127); + } /* make stdout for this process be the output file */ if (-1 == dup2(fileno(f),fileno(stdout))) @@ -347,7 +350,10 @@ load_image (char *filename, gint32 run_mode) else if (pid == 0) /* child process */ { FILE* f; - f = fopen(tmpname,"w"); + if (!(f = fopen(tmpname,"w"))){ + g_warning("gz: fopen failed: %s\n", g_strerror(errno)); + _exit(127); + } /* make stdout for this child process be the temp file */ if (-1 == dup2(fileno(f),fileno(stdout))) diff --git a/plug-ins/common/gz.c b/plug-ins/common/gz.c index 12df23b4ca..60ea376f6b 100644 --- a/plug-ins/common/gz.c +++ b/plug-ins/common/gz.c @@ -287,7 +287,10 @@ save_image (char *filename, else if (pid == 0) { - f = fopen(filename,"w"); + if (!(f = fopen(filename,"w"))){ + g_warning("gz: fopen failed: %s\n", g_strerror(errno)); + _exit(127); + } /* make stdout for this process be the output file */ if (-1 == dup2(fileno(f),fileno(stdout))) @@ -347,7 +350,10 @@ load_image (char *filename, gint32 run_mode) else if (pid == 0) /* child process */ { FILE* f; - f = fopen(tmpname,"w"); + if (!(f = fopen(tmpname,"w"))){ + g_warning("gz: fopen failed: %s\n", g_strerror(errno)); + _exit(127); + } /* make stdout for this child process be the temp file */ if (-1 == dup2(fileno(f),fileno(stdout))) diff --git a/plug-ins/gz/gz.c b/plug-ins/gz/gz.c index 12df23b4ca..60ea376f6b 100644 --- a/plug-ins/gz/gz.c +++ b/plug-ins/gz/gz.c @@ -287,7 +287,10 @@ save_image (char *filename, else if (pid == 0) { - f = fopen(filename,"w"); + if (!(f = fopen(filename,"w"))){ + g_warning("gz: fopen failed: %s\n", g_strerror(errno)); + _exit(127); + } /* make stdout for this process be the output file */ if (-1 == dup2(fileno(f),fileno(stdout))) @@ -347,7 +350,10 @@ load_image (char *filename, gint32 run_mode) else if (pid == 0) /* child process */ { FILE* f; - f = fopen(tmpname,"w"); + if (!(f = fopen(tmpname,"w"))){ + g_warning("gz: fopen failed: %s\n", g_strerror(errno)); + _exit(127); + } /* make stdout for this child process be the temp file */ if (-1 == dup2(fileno(f),fileno(stdout)))