summaryrefslogtreecommitdiff
path: root/src/cairo-output-stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-output-stream.c')
-rw-r--r--src/cairo-output-stream.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c
index 3b53aa93..e9b57278 100644
--- a/src/cairo-output-stream.c
+++ b/src/cairo-output-stream.c
@@ -339,18 +339,23 @@ stdio_flush (void *closure)
fflush (file);
- return CAIRO_STATUS_SUCCESS; /* XXX errors */
+ if (ferror (file))
+ return CAIRO_STATUS_WRITE_ERROR;
+ else
+ return CAIRO_STATUS_SUCCESS;
}
static cairo_status_t
stdio_close (void *closure)
{
+ cairo_status_t status;
FILE *file = closure;
- fflush (file);
+ status = stdio_flush (closure);
+
fclose (file);
- return CAIRO_STATUS_SUCCESS; /* XXX errors */
+ return status;
}
cairo_output_stream_t *