Example #1
0
int knode_final()
{
	if (!__g_knodecc)
		return 0;
	kmem_free_s(__g_knodecc->arr);
	kmem_free_sz(__g_knodecc);
	return 0;
}
Example #2
0
static int rpc_client_wch_clr(rpc_client_s *c)
{
	int i;

	for (i = 0; i < c->opts.cnt; i++) {
		kmem_free_s(c->opts.arr[i].path);
		if (c->opts.arr[i].wch)
			kopt_wch_del(c->opts.arr[i].wch);
		c->opts.arr[i].wch = NULL;
	}
	kmem_free_sz(c->opts.arr);
	c->opts.cnt = 0;

	return 0;
}
Example #3
0
static int rpc_client_wch_del(rpc_client_s *c, const char *path)
{
	int i;
	const char *tmp;

	for (i = 0; i < c->opts.cnt; i++) {
		tmp = c->opts.arr[i].path;
		if (tmp && (0 == strcmp(tmp, path))) {
			kmem_free_sz(c->opts.arr[i].path);
			kopt_wch_del(c->opts.arr[i].wch);
			c->opts.arr[i].wch = NULL;
			klog("%s deleted\n", path);
			return 0;
		}
	}

	kerror("%s not exists.\n", path);
	return -1;
}