# HG changeset patch # User Ethan Blanton # Date 1194565642 0 # Node ID abc909eeb5800a70a5327e473cb18f9a7e9558f7 # Parent 726f91be55ed7a9eeae069051e511de3264b54c0 jtb indirectly points out that we need a fflush() before the fsync(), which I forgot. diff -r 726f91be55ed -r abc909eeb580 libpurple/util.c --- a/libpurple/util.c Thu Nov 08 19:50:22 2007 +0000 +++ b/libpurple/util.c Thu Nov 08 23:47:22 2007 +0000 @@ -2602,6 +2602,13 @@ /* Apparently XFS (and possibly other filesystems) do not * guarantee that file data is flushed before file metadata, * so this procedure is insufficient without some flushage. */ + if (fflush(file) < 0) { + purple_debug_error("util", "Error flushing %s: %s\n", + filename_temp, g_strerror(errno)); + g_free(filename_temp); + fclose(file); + return FALSE; + } if (fsync(fileno(file)) < 0) { purple_debug_error("util", "Error syncing file contents for %s: %s\n", filename_temp, g_strerror(errno));