mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-06 05:08:29 +02:00
Integrated sd_notify to get status messages in systemd (#28)
* Integrated sd_notify to get status messages in systemd * reset color attributes after use in string
This commit is contained in:
@@ -55,6 +55,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "gamemode.h"
|
||||
#include "logging.h"
|
||||
|
||||
#include <systemd/sd-daemon.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -74,6 +75,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
static void sigint_handler(__attribute__((unused)) int signo)
|
||||
{
|
||||
LOG_MSG("Quitting by request...\n");
|
||||
sd_notify(0,"STATUS=GameMode is quitting by request...\n");
|
||||
|
||||
/* Clean up nicely */
|
||||
game_mode_context_destroy(game_mode_context_instance());
|
||||
@@ -144,4 +146,5 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Log we're finished */
|
||||
LOG_MSG("Quitting naturally...\n");
|
||||
sd_notify(0,"STATUS=GameMode is quitting naturally...\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user