mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 04:15:49 +01:00
Handle the return value to fwrite properly
This commit is contained in:
parent
4dd500c22a
commit
f3d30afed7
@ -96,6 +96,7 @@ write_out_typelib (gchar *prefix,
|
|||||||
GTypelib *typelib)
|
GTypelib *typelib)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
gsize written;
|
||||||
|
|
||||||
if (output == NULL)
|
if (output == NULL)
|
||||||
{
|
{
|
||||||
@ -127,7 +128,14 @@ write_out_typelib (gchar *prefix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!code)
|
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
|
else
|
||||||
{
|
{
|
||||||
gchar *code;
|
gchar *code;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user