if (h->ch)
g_io_channel_unref(h->ch);
- *(h->handler_p) = NULL;
+ if (h->handler_p != NULL)
+ *(h->handler_p) = NULL;
+
free(h);
return 0;
h->ch = ch;
h->id = id;
h->handler_p = handler;
-
- *handler = h;
+ if (handler != NULL)
+ *handler = h;
return 0;
}
unsigned long long limit_bytes, enum proc_action action)
{
int fd;
- fd_handler_h fdh = NULL;
gpointer hash_entry;
struct memory_limit_event *mle = NULL;
char buf[MAX_DEC_SIZE(int)] = {0};
}
mle->action = action;
mle->threshold_bytes = limit_bytes;
- add_fd_read_handler(fd, memory_action_cb, mle->path, NULL, &fdh);
- mle->fdh = fdh;
+ add_fd_read_handler(fd, memory_action_cb, mle->path, NULL, NULL);
g_hash_table_insert(memory_limit_hash, (gpointer)mle->path,
(gpointer)mle);
{
int ret;
int master_sock = fd;
- static fd_handler_h handler;
socklen_t len;
struct sockaddr_un cli = { 0 };
/* Add event handler to receive data from the client */
ret = add_fd_read_handler(new_sock, cpu_boosting_recv_from_client,
- NULL, NULL, &handler);
+ NULL, NULL, NULL);
if (ret < 0) {
_E("[CPU-BOOSTING] Failed to add event handler of (sock = %d)", new_sock);
close(new_sock);