summaryrefslogtreecommitdiff
path: root/src/cairo-output-stream.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-04-12 13:44:14 -0700
committerCarl Worth <cworth@cworth.org>2006-04-12 13:44:14 -0700
commitd9137e56b6a8f1ddb44a01bf34301117b0696f0b (patch)
tree30d5d95069d48d018e1e2be1181c51a8772257b1 /src/cairo-output-stream.c
parent32994379db92ef8208ba11b825b1246e2b442566 (diff)
Use ferror to get error checking for stdio-based output streams.
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 *