Compile cleanly with when _FORTIFY_SOURCE is defined. This definition

is forced when building RPMs on FC4.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13333 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton
2006-02-20 22:00:38 +00:00
parent b5713ba30c
commit b575dc47af
10 changed files with 56 additions and 26 deletions

View File

@@ -254,8 +254,10 @@ gsf_output_stdio_close (GsfOutput *output)
stdio->st.st_uid,
stdio->st.st_gid)) {
/* We cannot set both. Maybe we can set one. */
chown (stdio->real_filename, -1, stdio->st.st_gid);
chown (stdio->real_filename, stdio->st.st_uid, -1);
if (!chown (stdio->real_filename, -1, stdio->st.st_gid)) {
gint dc; /* Don't care */
dc = chown (stdio->real_filename, stdio->st.st_uid, -1);
}
}
chmod_wrapper (stdio->real_filename, stdio->st.st_mode);
#endif

View File

@@ -130,7 +130,7 @@ void
gsf_input_dump (GsfInput *input, gboolean dump_as_hex)
{
gsf_off_t offset = 0;
size_t size, count;
size_t size, count, count2, written;
guint8 const *data;
/* read in small blocks to excercise things */
@@ -143,8 +143,13 @@ gsf_input_dump (GsfInput *input, gboolean dump_as_hex)
g_return_if_fail (data != NULL);
if (dump_as_hex)
gsf_mem_dump_full (data, count, offset);
else
fwrite (data, 1, count, stdout);
else {
count2 = count;
do {
written = fwrite (data, 1, count2, stdout);
count2 -= written;
} while (count2 > 0);
}
size -= count;
offset += count;
}