After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635307 - iconcache: Ensure we don't lose data on power loss
iconcache: Ensure we don't lose data on power loss
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-11-19 20:47 UTC by Colin Walters
Modified: 2010-11-22 19:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
iconcache: Ensure we don't lose data on power loss (1.03 KB, patch)
2010-11-19 20:47 UTC, Colin Walters
none Details | Review
iconcache: Ensure we don't lose data on power loss (2.28 KB, patch)
2010-11-19 22:11 UTC, Colin Walters
accepted-commit_now Details | Review

Description Colin Walters 2010-11-19 20:47:52 UTC
fsync() should ensure our data hits disk; since corrupt icon
caches break all apps, we need to ensure it's valid.
Comment 1 Colin Walters 2010-11-19 20:47:53 UTC
Created attachment 174888 [details] [review]
iconcache: Ensure we don't lose data on power loss
Comment 2 Matthias Clasen 2010-11-19 21:58:06 UTC
Review of attachment 174888 [details] [review]:

Other than that, sounds ok.

::: gtk/updateiconcache.c
@@ +1497,3 @@
+      g_printerr (_("Failed to write cache file: %s\n"), g_strerror (errno));
+      exit (1);
+    }

If we want to be anal here, we probably don't want to ignore the return value of fclose either...
Comment 3 Colin Walters 2010-11-19 22:11:23 UTC
(In reply to comment #2)
> Review of attachment 174888 [details] [review]:
> 
> Other than that, sounds ok.
> 
> ::: gtk/updateiconcache.c
> @@ +1497,3 @@
> +      g_printerr (_("Failed to write cache file: %s\n"), g_strerror (errno));
> +      exit (1);
> +    }
> 
> If we want to be anal here, we probably don't want to ignore the return value
> of fclose either...

You're absolutely right, new patch incoming.
Comment 4 Colin Walters 2010-11-19 22:11:27 UTC
Created attachment 174891 [details] [review]
iconcache: Ensure we don't lose data on power loss

fsync() should ensure our data hits disk; since corrupt icon
caches break all apps, we need to ensure it's valid.
Comment 5 Matthias Clasen 2010-11-22 17:35:56 UTC
Review of attachment 174891 [details] [review]:

Looks good now.
Comment 6 Colin Walters 2010-11-22 19:27:58 UTC
Committed to gtk-2-24.  Note this patch could go into gtk3, but better to remove gtk-update-icon-cache-3.0 entirely.
Comment 7 Javier Jardón (IRC: jjardon) 2010-11-22 19:51:31 UTC
Committed to master as commit 6c6b49392629a8ee2facafb66c8867a49a3e9036

(In reply to comment #6)
> Committed to gtk-2-24.  Note this patch could go into gtk3, but better to
> remove gtk-update-icon-cache-3.0 entirely.

Why?