From 8490e31fdeab3e232be5c0a5f367bc1a032ac37b Mon Sep 17 00:00:00 2001 From: "Alexey I. Froloff" Date: Sun, 29 Mar 2009 16:53:00 +0400 Subject: [PATCH] Atomic save for session This patch is part of "Atomic saves for history and session" from http://git.altlinux.org/people/raorn/packages/WindowMaker.git --- src/session.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/session.c b/src/session.c index 17a2d5a7..5e55a96d 100644 --- a/src/session.c +++ b/src/session.c @@ -1003,7 +1003,11 @@ static void smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data) plState = WMCreatePLDictionary(WMCreatePLString("Version"), WMCreatePLString("1.0"), WMCreatePLString("Screens"), state, NULL); - WMWritePropListToFile(plState, statefile, False); + if (!WMWritePropListToFile(plState, statefile, True)) { + wwarning(_("error while saving session state")); + WMReleasePropList(plState); + goto fail; + } WMReleasePropList(plState);