+ msg_Dbg (p_this, "writing plugins cache %s", psz_filename);
+ if (CacheSaveBank (file, p_bank))
+ goto error;
+
+#ifndef WIN32
+ utf8_rename (psz_tmpname, psz_filename); /* atomically replace old cache */
+ fclose (file);
+#else
+ utf8_unlink (psz_filename);
+ fclose (file);
+ utf8_rename (psz_tmpname, psz_filename);
+#endif
+ return; /* success! */
+
+error:
+ msg_Warn (p_this, "could not write plugins cache %s (%m)",
+ psz_filename);
+ if (file != NULL)
+ {
+ clearerr (file);
+ fclose (file);
+ }
+}
+
+static int CacheSaveConfig (FILE *, module_t *);
+static int CacheSaveSubmodule (FILE *, module_t *);
+
+static int CacheSaveBank (FILE *file, module_bank_t *p_bank)
+{
+ uint32_t i_file_size = 0;
+