Plugin configuration lost when the xfce4-panel process crashes

The timer plugin's save_settings() explicitly truncates the rc file with fopen(file, "w") before opening it through xfce_rc_simple_open(file, FALSE). If xfce4-panel or the plugin crashes between that truncation and xfce_rc_close(), the existing configuration is destroyed and the file remains empty.

This matches observed behavior: after xfce4-panel crashes, xfce4-timer-plugin loses all configuration.

The save path should be made atomic: write to a temporary file in the same directory, close/fsync it, then rename it over the original config file. The current truncate-then-rewrite approach is not crash-safe.

A fix:

xfce4-timer-plugin-save-settings-atomically.patch

Edited by Artem S. Tashkinov