Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@litl.com>2009-02-21 02:58:22 (GMT)
committer Johan Dahlin <johan@gnome.org>2009-02-21 03:05:49 (GMT)
commit0dc4a175fe57c6f133eb26307aed6eb53a3d30d1 (patch)
treebe8fe09217ad155f300d49567ed7ca8f1ef9ae85
parentfe7cf3373f886cb583867d248eab805091422233 (diff)
Handle the return value to fwrite properly
-rw-r--r--tools/compiler.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/compiler.c b/tools/compiler.c
index d4de9cd..6c6bae6 100644
--- a/tools/compiler.c
+++ b/tools/compiler.c
@@ -96,6 +96,7 @@ write_out_typelib (gchar *prefix,
GTypelib *typelib)
{
FILE *file;
+ gsize written;
if (output == NULL)
{
@@ -127,7 +128,14 @@ write_out_typelib (gchar *prefix,
}
if (!code)
- fwrite (typelib->data, 1, typelib->len, file);
+ {
+ written = fwrite (typelib->data, 1, typelib->len, file);
+ if (written < typelib->len) {
+ g_error ("ERROR: Could not write the whole output: %s",
+ strerror(errno));
+ return;
+ }
+ }
else
{
gchar *code;