}
sensor_provider::sensor_provider(const char *uri)
-: m_connected(false)
+: g_src(NULL)
+, m_socket(NULL)
+, m_connected(false)
, m_start_cb(NULL)
, m_stop_cb(NULL)
, m_interval_changed_cb(NULL)
, m_stop_user_data(NULL)
, m_interval_changed_user_data(NULL)
, m_attribute_str_user_data(NULL)
-, g_src(NULL)
{
init(uri);
m_loop = g_main_loop_new(NULL, FALSE);
int sensor_provider::connect(void)
{
m_socket = new(std::nothrow) ipc::socket();
- retvm_if(!m_socket, NULL, "Failed to allocate memory");
+ retvm_if(!m_socket, 0, "Failed to allocate memory");
if (!m_socket->create(SENSOR_CHANNEL_PATH)) {
delete m_socket;
GIOChannel *ch = NULL;
ch = g_io_channel_unix_new(m_socket->get_fd());
- retvm_if(!ch, NULL, "Failed to create g_io_channel_unix_new");
+ retvm_if(!ch, 0, "Failed to create g_io_channel_unix_new");
g_src = g_io_create_watch(ch, (GIOCondition) (ipc::EVENT_IN | ipc::EVENT_HUP | ipc::EVENT_NVAL));
g_io_channel_unref(ch);
uint64_t channel::connect(channel_handler *handler, event_loop *loop, bool loop_bind)
{
m_socket = new(std::nothrow) socket();
- retvm_if(!m_socket, NULL, "Failed to allocate memory");
+ retvm_if(!m_socket, 0, "Failed to allocate memory");
if (!m_socket->create(SENSOR_CHANNEL_PATH)) {
delete m_socket;
return 0;
m_handler = new(std::nothrow) channel_event_handler(this, handler);
- retvm_if(!m_handler, NULL, "Failed to allocate memory");
+ retvm_if(!m_handler, 0, "Failed to allocate memory");
bind(loop, loop_bind);