Do config file replacements atomically.

Do save snaps on exit.


SVN revision: 7332
This commit is contained in:
Kim Woelders 2003-08-17 10:15:16 +00:00
parent cdd2a408a9
commit d9d2c0fb04
4 changed files with 5 additions and 5 deletions

View File

@ -3687,7 +3687,6 @@ LoadEConfig(char *themelocation)
fclose(f);
}
Esnprintf(ss, sizeof(ss), "%s/user_theme.cfg", UserEDir());
rm(ss);
mv(s, ss);
if (!isfile(ss))
Alert(_

View File

@ -230,7 +230,7 @@ EExit(void *code)
for (i = 0; i < child_count; i++)
kill(e_children[i], SIGINT);
}
SaveSnapInfo();
Real_SaveSnapInfo(0, NULL);
exit(exitcode);
EDBUG_RETURN(exitcode);

View File

@ -237,7 +237,6 @@ SaveWindowStates(void)
}
fclose(f);
Esnprintf(ss, sizeof(ss), "%s.clients.%i", GetSMFile(), root.scr);
rm(ss);
mv(s, ss);
if (!isfile(ss))
Alert(_
@ -430,7 +429,6 @@ autosave(void)
Real_SaveSnapInfo(0, NULL);
Etmp(s);
SaveUserControlConfig(fopen(s, "w"));
rm(GetGenericSMFile());
mv(s, GetGenericSMFile());
if (!isfile(GetGenericSMFile()))
Alert(_

View File

@ -870,6 +870,7 @@ Real_SaveSnapInfo(int dumval, void *dumdat)
f = fopen(s, "w");
if (!f)
return;
lst = (Snapshot **) ListItemType(&num, LIST_TYPE_SNAPSHOT);
if (lst)
{
@ -920,12 +921,14 @@ Real_SaveSnapInfo(int dumval, void *dumdat)
}
Efree(lst);
}
fclose(f);
Esnprintf(buf, sizeof(buf), "%s.snapshots.%i", GetGenericSMFile(), root.scr);
rm(buf);
mv(s, buf);
if (!isfile(buf))
Alert(_("Error saving snaps file\n"));
SaveGroups();
}