#include <lwipc.h>
#endif
+#include <signal.h>
+
#include "../include/mm_sound_common.h"
#include "include/mm_sound_mgr_focus.h"
#include "include/mm_sound_mgr_focus_dbus.h"
static int _get_option(int argc, char **argv, server_arg *arg);
static int _usage(int argc, char **argv);
-static struct sigaction sigint_action; /* Backup pointer of SIGINT handler */
-static struct sigaction sigabrt_action; /* Backup pointer of SIGABRT signal handler */
-static struct sigaction sigsegv_action; /* Backup pointer of SIGSEGV fault signal handler */
-static struct sigaction sigterm_action; /* Backup pointer of SIGTERM signal handler */
-static struct sigaction sigsys_action; /* Backup pointer of SIGSYS signal handler */
-static void _exit_handler(int sig);
-
GMainLoop *g_mainloop;
static void _mainloop_run()
return 0;
}
-//__attribute__ ((destructor))
-static void _exit_handler(int sig)
-{
- switch (sig) {
- case SIGINT:
- sigaction(SIGINT, &sigint_action, NULL);
- debug_error("signal(SIGINT) error");
- break;
- case SIGABRT:
- sigaction(SIGABRT, &sigabrt_action, NULL);
- debug_error("signal(SIGABRT) error");
- break;
- case SIGSEGV:
- sigaction(SIGSEGV, &sigsegv_action, NULL);
- debug_error("signal(SIGSEGV) error");
- break;
- case SIGTERM:
- sigaction(SIGTERM, &sigterm_action, NULL);
- debug_error("signal(SIGTERM) error");
- break;
- case SIGSYS:
- sigaction(SIGSYS, &sigsys_action, NULL);
- debug_error("signal(SIGSYS) error");
- break;
- default:
- break;
- }
- raise(sig);
-}
-
static int _usage(int argc, char **argv)
{
fprintf(stderr, "Usage: %s [Options]\n", argv[0]);
{
sem_t* sem = NULL;
server_arg serveropt;
- struct sigaction action;
#if !defined(USE_SYSTEM_SERVER_PROCESS_MONITORING)
int pid;
#endif
int fd_ss_ready = -1;
#endif
- action.sa_handler = _exit_handler;
- action.sa_flags = 0;
- sigemptyset(&action.sa_mask);
-
if (_get_option(argc, argv, &serveropt))
return 1;
}
}
#endif
- sigaction(SIGABRT, &action, &sigabrt_action);
- sigaction(SIGSEGV, &action, &sigsegv_action);
- sigaction(SIGTERM, &action, &sigterm_action);
- sigaction(SIGSYS, &action, &sigsys_action);
-
if (serveropt.startserver) {
MMSoundMgrFocusDbusInit();
MMSoundMgrFocusInit();