/* flush the file and make sure the OS's buffer has been written to disk */
gint fflush_ret, fsync_ret;
int file_fd;
+
file_fd = fileno (cache->cache_file);
do {
return TRUE;
/* ERRORS */
+fail_before_fclose:
+ {
+ fclose (cache->cache_file);
+ }
+ /* fall through */
fail_after_fclose:
{
g_unlink (cache->tmp_location);
fflush_failed:
{
GST_ERROR ("fflush() failed: %s", g_strerror (errno));
- goto fail_after_fclose;
+ goto fail_before_fclose;
}
-fclose_failed:
+fsync_failed:
{
GST_ERROR ("fsync() failed: %s", g_strerror (errno));
- goto fail_after_fclose;
+ goto fail_before_fclose;
}
-fsync_failed:
+fclose_failed:
{
GST_ERROR ("fclose() failed: %s", g_strerror (errno));
goto fail_after_fclose;