When the deviced gets SIGHUP, display calls pm_save_logdump().
Move SIGHUP handler to the core because there is no reason for the same handler to exist
in the all plugins.
Change-Id: I794de3869520229ef87c8c6a4b4e3d3695d82214
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
return UNKNOWN_STR;
}
-/* SIGHUP signal handler
- * For debug... print info to syslog
- */
-static void sig_hup(int signo)
-{
- _I("received sig hub %d", signo);
-
- pm_save_logdump();
-}
-
static void init_lcd_operation(void)
{
const struct device_ops *ops = NULL;
_I("Start power manager.");
- signal(SIGHUP, sig_hup);
-
/* load configutation */
ret = display_load_config(&display_conf);
if (ret < 0)
return 0;
}
-/* SIGHUP signal handler
- * For debug... print info to syslog
- */
-static void sig_hup(int signo)
-{
- _I("received sig hub %d", signo);
-
- pm_save_logdump();
-}
-
static void init_lcd_operation(void)
{
const struct device_ops *ops = NULL;
_I("Start power manager.");
- signal(SIGHUP, sig_hup);
-
/* load configutation */
ret = display_load_config(&display_conf);
if (ret < 0)
return UNKNOWN_STR;
}
-/* SIGHUP signal handler
- * For debug... print info to syslog
- */
-static void sig_hup(int signo)
-{
- _I("received sig hub %d", signo);
-
- pm_save_logdump();
-}
-
static void init_lcd_operation(void)
{
const struct device_ops *ops = NULL;
_I("Start power manager.");
- signal(SIGHUP, sig_hup);
-
/* load configutation */
ret = display_load_config(&display_conf);
if (ret < 0)
return 0;
}
-/* SIGHUP signal handler
- * For debug... print info to syslog
- */
-static void sig_hup(int signo)
-{
- _I("received sig hub %d", signo);
-
- pm_save_logdump();
-}
-
/*
* default transition function
* 1. call check
_I("Start power manager.");
- signal(SIGHUP, sig_hup);
-
/* load configutation */
ret = display_load_config(&display_conf);
if (ret < 0)
* limitations under the License.
*/
+#include <signal.h>
+
#include <libsyscommon/list.h>
#include <shared/devices.h>
#include "display-misc.h"
#include "display-signal.h"
#include "display-state-transition.h"
+#include "lock-detector.h"
static const struct device_ops *display_plugin_device_ops;
static int pm_cur_state;
}
}
+static gboolean handle_sighup(gpointer data)
+{
+ int signo = (int) data;
+ _I("received sig hub %d", signo);
+ pm_save_logdump();
+
+ return G_SOURCE_REMOVE;
+}
+
static int display_probe(void *data)
{
display_plugin_device_ops = find_device("display-plugin");
if (!display_plugin_device_ops || !display_plugin_device_ops->init)
return;
+ g_unix_signal_add(SIGHUP, handle_sighup, (gpointer) SIGHUP);
display_plugin_device_ops->init(data);
display_signal_register_display_brightness_notifier();