Added a flag to the exit signal
This boolean can be used to differentiate between restarts and exits. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
07e63bd564
commit
471babcc70
|
@ -57,9 +57,10 @@ static char *awesome_argv;
|
|||
/** Call before exiting.
|
||||
*/
|
||||
void
|
||||
awesome_atexit(void)
|
||||
awesome_atexit(bool restart)
|
||||
{
|
||||
signal_object_emit(globalconf.L, &global_signals, "exit", 0);
|
||||
lua_pushboolean(globalconf.L, restart);
|
||||
signal_object_emit(globalconf.L, &global_signals, "exit", 1);
|
||||
|
||||
a_dbus_cleanup();
|
||||
|
||||
|
@ -276,7 +277,7 @@ exit_on_signal(EV_P_ ev_signal *w, int revents)
|
|||
void
|
||||
awesome_restart(void)
|
||||
{
|
||||
awesome_atexit();
|
||||
awesome_atexit(true);
|
||||
a_exec(awesome_argv);
|
||||
}
|
||||
|
||||
|
@ -571,7 +572,7 @@ main(int argc, char **argv)
|
|||
ev_ref(globalconf.loop);
|
||||
ev_io_stop(globalconf.loop, &xio);
|
||||
|
||||
awesome_atexit();
|
||||
awesome_atexit(false);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -22,8 +22,10 @@
|
|||
#ifndef AWESOME_AWESOME_H
|
||||
#define AWESOME_AWESOME_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
void awesome_restart(void);
|
||||
void awesome_atexit(void);
|
||||
void awesome_atexit(bool restart);
|
||||
|
||||
#endif
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||
|
|
Loading…
Reference in New Issue