cleanup temporary directory when restarting and not using XDG_RUNTIME_DIR

fixes #1253
This commit is contained in:
Michael Stapelberg
2014-06-11 09:17:43 +02:00
parent 6fe44d8584
commit 94574db6f6
4 changed files with 66 additions and 2 deletions

View File

@ -1682,6 +1682,14 @@ void cmd_reload(I3_CMD) {
*/
void cmd_restart(I3_CMD) {
LOG("restarting i3\n");
ipc_shutdown();
/* We need to call this manually since atexit handlers dont get called
* when exec()ing */
purge_zerobyte_logfile();
/* The unlink call is intentionally after the purge_zerobyte_logfile() so
* that the latter does not remove the directory yet. We need to store the
* restart layout state in there. */
unlink(config.ipc_socket_path);
i3_restart(false);
// XXX: default reply for now, make this a better reply