• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GRID_DEBUG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GRID_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ GRID_DEBUG函数的具体用法?C++ GRID_DEBUG怎么用?C++ GRID_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GRID_DEBUG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _configure_events_queue

static gboolean
_configure_events_queue (struct sqlx_service_s *ss)
{
	if (ss->flag_no_event) {
		GRID_DEBUG("Events queue disabled, the service disabled it");
		return TRUE;
	}

	gchar *url =  gridcluster_get_eventagent (SRV.ns_name);
	STRING_STACKIFY (url);

	if (!url) {
		GRID_DEBUG("Events queue disabled, no URL configured");
		return TRUE;
	}

	GError *err = oio_events_queue_factory__create(url, &ss->events_queue);

	if (!ss->events_queue) {
		GRID_WARN("Events queue creation failure: (%d) %s", err->code, err->message);
		return FALSE;
	}

	GRID_INFO("Event queue ready, connected to [%s]", url);
	return TRUE;
}
开发者ID:live-for-dream,项目名称:oio-sds,代码行数:26,代码来源:sqlx_service.c


示例2: hc_delete_container

gs_error_t *
hc_delete_container(gs_grid_storage_t *hc, struct hc_url_s *url, int force, int flush)
{
	gs_error_t *e = NULL;
	gs_container_t *c = NULL;
	unsigned int flags = 0;

	if (force) flags |= M2V2_DESTROY_FORCE;

	// to flush by meta2, but without event generated
	//if (flush) flags |= M2V2_DESTROY_FLUSH;

	c = gs_get_storage_container(hc, hc_url_get(url, HCURL_REFERENCE), NULL, 0, &e);
	if(NULL != c) {

		// to flush by this process, but with event generated
		if (flush) {
			if (gs_flush_container(c, &e)) {
				GRID_DEBUG("Container flushed\n");
		    }
		}

		// destroy container
		if (!e) {
			if (gs_destroy_container_flags (c, flags, &e)) {
				GRID_DEBUG("Container deleted\n");
			}
		}
		gs_container_free(c);
	}
	return e;
}
开发者ID:amogrid,项目名称:redcurrant,代码行数:32,代码来源:hc_func.c


示例3: hc_upload_content

static gs_error_t *
hc_upload_content(gs_grid_storage_t *hc, struct hc_url_s *url, const char *local_path,
		const char *stgpol, const char *sys_metadata, int ac, gboolean is_append)
{
	int in = -1;
	struct stat64 s;
	gs_container_t *c = NULL;
	gs_error_t *e = NULL;

	/*init the local path */
	if (-1 == stat64(local_path, &s)) {
		e = g_malloc0(sizeof(gs_error_t));
		e->code = errno;
		e->msg = g_strdup_printf("Cannot stat the local file (%s)\n", strerror(errno));
		return e;
	}
	GRID_DEBUG("Local path %s found\n", local_path);

	if (-1 == (in = open(local_path, O_RDONLY|O_LARGEFILE))) {
		e = g_malloc0(sizeof(gs_error_t));
		e->code = errno;
		e->msg = g_strdup_printf("Cannot open the local file (%s)\n", strerror(errno));
		goto end_put;
	}
	GRID_DEBUG("Local path %s found and opened\n", local_path);

	if(!(c = gs_get_storage_container(hc, hc_url_get(url, HCURL_REFERENCE), NULL, ac, &e))) {
		g_printerr("Failed to resolve and/or create meta2 entry for reference %s\n",
				hc_url_get(url, HCURL_REFERENCE));
		goto end_put;
	}

	/*upload the content */
	if (is_append) {
		if (!gs_append_content(c, hc_url_get(url, HCURL_PATH), s.st_size, _feed_from_fd, &in, &e)) {
			goto end_put;
		}
	} else {
		if (!gs_upload(c, hc_url_get(url, HCURL_PATH), s.st_size, _feed_from_fd,
				&in, NULL, sys_metadata, stgpol, &e)) {
			goto end_put;
		}
	}
	GRID_INFO("Uploaded a new version of content [%s] in container [%s]\n\n",
			hc_url_get(url, HCURL_PATH), hc_url_get(url, HCURL_REFERENCE));
	GRID_DEBUG("Content successfully uploaded!\n");

end_put:

	/** FIXME TODO XXX why not (in >= 0) or (in > -1) ? */
	if (in > 1)
		metautils_pclose(&in);

	if(NULL != c) {
		gs_container_free(c);
		c = NULL;
	}

	return e;
}
开发者ID:amogrid,项目名称:redcurrant,代码行数:60,代码来源:hc_func.c


示例4: _zmq2agent_send_event

static gboolean
_zmq2agent_send_event (time_t now, struct _zmq2agent_ctx_s  *ctx,
		struct event_s *evt, const char *dbg)
{
	int rc;

	if (ctx->last_error == now) {
		GRID_DEBUG("ZMQ2AGENT event delayed, stream paused");
		return FALSE;
	}

	evt->last_sent = now;
retry:
	rc = zmq_send (ctx->zagent, "", 0, more|ZMQ_DONTWAIT);
	if (rc == 0) {
		rc = zmq_send (ctx->zagent, evt, HEADER_SIZE, more|ZMQ_DONTWAIT);
		if (rc == HEADER_SIZE)
			rc = zmq_send (ctx->zagent, evt->message, evt->size, ZMQ_DONTWAIT);
	}

	if (rc < 0) {
		if (EINTR == (rc = zmq_errno ()))
			goto retry;
		ctx->last_error = evt->last_sent;
		GRID_INFO("EVT:ERR %s (%d) %s", dbg, rc, zmq_strerror(rc));
		return FALSE;
	} else {
		++ ctx->q->counter_sent;
		ctx->last_error = 0;
		GRID_DEBUG("EVT:SNT %s", dbg);
		return TRUE;
	}
}
开发者ID:live-for-dream,项目名称:oio-sds,代码行数:33,代码来源:oio_events_queue_zmq.c


示例5: _meta2_filter_check_ns_name

static int
_meta2_filter_check_ns_name(struct gridd_filter_ctx_s *ctx,
		struct gridd_reply_ctx_s *reply, int optional)
{
	(void) reply;
	TRACE_FILTER();
	const struct meta2_backend_s *backend = meta2_filter_ctx_get_backend(ctx);
	const char *req_ns = oio_url_get(meta2_filter_ctx_get_url(ctx), OIOURL_NS);

	if (!backend || !backend->ns_name[0]) {
		GRID_DEBUG("Missing information for namespace checking");
		meta2_filter_ctx_set_error(ctx, SYSERR("backend not ready"));
		return FILTER_KO;
	}

	if (!req_ns) {
		if (optional)
			return FILTER_OK;
		GRID_DEBUG("Missing namespace name in request");
		meta2_filter_ctx_set_error(ctx, BADREQ("No namespace"));
		return FILTER_KO;
	}

	if (0 != g_ascii_strcasecmp(backend->ns_name, req_ns)) {
		meta2_filter_ctx_set_error(ctx, BADNS());
		return FILTER_KO;
	}

	return FILTER_OK;
}
开发者ID:huayuxian,项目名称:oio-sds,代码行数:30,代码来源:meta2_filters_check.c


示例6: _sqlx_exec

/* XXX JFS dupplicated from sqliterepo/sqlite_utils.c */
static int
_sqlx_exec(sqlite3 *handle, const char *sql)
{
	int rc, grc = SQLITE_OK;
	sqlite3_stmt *stmt = NULL;

	while ((grc == SQLITE_OK) && sql && *sql) {
		const char *next = NULL;
		rc = sqlite3_prepare(handle, sql, -1, &stmt, &next);
		GRID_DEBUG("sqlite3_prepare(%s) = %d", sql, rc);
		sql = next;
		if (rc != SQLITE_OK && rc != SQLITE_DONE)
			grc = rc;
		else {
			if (stmt) {
				do {
					rc = sqlite3_step(stmt);
					GRID_DEBUG("sqlite3_step() = %d", rc);
				} while (rc == SQLITE_ROW);
				if (rc != SQLITE_OK && rc != SQLITE_DONE)
					grc = rc;
			}
		}
		if (stmt) {
			rc = sqlite3_finalize(stmt);
			GRID_DEBUG("sqlite3_finalize() = %d", rc);
			stmt = NULL;
			if (rc != SQLITE_OK && rc != SQLITE_DONE)
				grc = rc;
		}
	}

	return grc;
}
开发者ID:chrisz,项目名称:oio-sds,代码行数:35,代码来源:sqlx_client_local.c


示例7: _meta2_filter_check_ns_name

static int
_meta2_filter_check_ns_name(struct gridd_filter_ctx_s *ctx,
		struct gridd_reply_ctx_s *reply, int optional)
{
	(void) reply;
	TRACE_FILTER();
	const struct meta2_backend_s *backend = meta2_filter_ctx_get_backend(ctx);
	const char *req_ns = oio_url_get(meta2_filter_ctx_get_url(ctx), OIOURL_NS);

	if (!backend || !backend->ns_name[0]) {
		GRID_DEBUG("Missing information for namespace checking");
		meta2_filter_ctx_set_error(ctx, NEWERROR(CODE_INTERNAL_ERROR,
					"Missing backend information, cannot check namespace"));
		return FILTER_KO;
	}

	if (!req_ns) {
		if (optional)
			return FILTER_OK;
		GRID_DEBUG("Missing namespace name in request");
		meta2_filter_ctx_set_error(ctx, NEWERROR(CODE_BAD_REQUEST,
					"Bad Request: Missing namespace name information"));
		return FILTER_KO;
	}

	if (0 != g_ascii_strcasecmp(backend->ns_name, req_ns)) {
		meta2_filter_ctx_set_error(ctx, NEWERROR(CODE_BAD_REQUEST,
					"Request namespace [%s] does not match server namespace [%s]",
					req_ns, backend->ns_name));
		return FILTER_KO;
	}

	return FILTER_OK;
}
开发者ID:InGenious-Justice,项目名称:oio-sds,代码行数:34,代码来源:meta2_filters_check.c


示例8: meta2_filter_action_has_container

int
meta2_filter_action_has_container(struct gridd_filter_ctx_s *ctx,
		struct gridd_reply_ctx_s *reply)
{
	(void) reply;
	struct meta2_backend_s *m2b = meta2_filter_ctx_get_backend(ctx);
	struct hc_url_s *url = meta2_filter_ctx_get_url(ctx);

	if (!url) {
		GRID_WARN("BUG : Checking container's presence : URL not set");
		return FILTER_OK;
	}

	GError *e = meta2_backend_has_container(m2b, url);
	if(NULL != e) {
		if (e->code == CODE_UNAVAILABLE)
			GRID_DEBUG("Container %s exists but could not open it: %s",
					hc_url_get(url, HCURL_WHOLE), e->message);
		else
			GRID_DEBUG("No such container (%s)", hc_url_get(url, HCURL_WHOLE));
		if (e->code == CODE_CONTAINER_NOTFOUND) {
			hc_decache_reference_service(m2b->resolver, url, META2_TYPE_NAME);
		}
		meta2_filter_ctx_set_error(ctx, e);
		return FILTER_KO;
	}
	return FILTER_OK;
}
开发者ID:redcurrant,项目名称:redcurrant,代码行数:28,代码来源:meta2_filters_action_container.c


示例9: network_server_run

GError *
network_server_run(struct network_server_s *srv)
{
	struct endpoint_s **pu, *u;
	time_t now, last_update;
	GError *err = NULL;

	/* Sanity checks */
	EXTRA_ASSERT(srv != NULL);
	for (pu=srv->endpointv; (u = *pu) ;pu++) {
		if (u->fd < 0)
			return NEWERROR(EINVAL,
					"DESIGN ERROR : some servers are not open");
	}
	if (!srv->flag_continue)
		return NULL;

	for (pu=srv->endpointv; srv->flag_continue && (u = *pu) ;pu++)
		ARM_ENDPOINT(srv, u, EPOLL_CTL_ADD);
	ARM_WAKER(srv, EPOLL_CTL_ADD);

	_server_start_one_worker(srv, FALSE);
	srv->thread_events = g_thread_new("events", _thread_cb_events, srv);

	clock_gettime(CLOCK_MONOTONIC_COARSE, &srv->now);
	last_update = network_server_bogonow(srv);
	while (srv->flag_continue) {
		now = network_server_bogonow(srv);
		if (last_update < now) {
			_server_update_main_stats(srv);
			last_update = now;
		}
		usleep(_start_necessary_threads(srv) ? 50000 : 500000);
		clock_gettime(CLOCK_MONOTONIC_COARSE, &srv->now);
	}

	network_server_close_servers(srv);

	/* Wait for all the workers */
	while (srv->workers_total) {
		GRID_DEBUG("Waiting for %u workers to die", srv->workers_total);
		usleep(200000);
		clock_gettime(CLOCK_MONOTONIC_COARSE, &srv->now);
	}
	srv->thread_first_worker = NULL;

	/* wait for the first event thread */
	if (srv->thread_events) {
		g_thread_join(srv->thread_events);
		srv->thread_events = NULL;
	}

	ARM_WAKER(srv, EPOLL_CTL_DEL);

	GRID_DEBUG("Server %p exiting its main loop", srv);
	return err;
}
开发者ID:Narthorn,项目名称:oio-sds,代码行数:57,代码来源:network_server.c


示例10: _configure_with_arguments

static gboolean
_configure_with_arguments(struct sqlx_service_s *ss, int argc, char **argv)
{
	// Sanity checks
	if (ss->sync_mode_solo > SQLX_SYNC_FULL) {
		GRID_WARN("Invalid SYNC mode for not-replicated bases");
		return FALSE;
	}
	if (ss->sync_mode_repli > SQLX_SYNC_FULL) {
		GRID_WARN("Invalid SYNC mode for replicated bases");
		return FALSE;
	}
	if (!ss->url) {
		GRID_WARN("No URL!");
		return FALSE;
	}
	if (!ss->announce) {
		ss->announce = g_string_new(ss->url->str);
		GRID_DEBUG("No announce set, using endpoint [%s]", ss->announce->str);
	}
	if (!metautils_url_valid_for_bind(ss->url->str)) {
		GRID_ERROR("Invalid URL as a endpoint [%s]", ss->url->str);
		return FALSE;
	}
	if (!metautils_url_valid_for_connect(ss->announce->str)) {
		GRID_ERROR("Invalid URL to be announced [%s]", ss->announce->str);
		return FALSE;
	}
	if (argc < 2) {
		GRID_ERROR("Not enough options, see usage.");
		return FALSE;
	}

	// Positional arguments
	gsize s = g_strlcpy(ss->ns_name, argv[0], sizeof(ss->ns_name));
	if (s >= sizeof(ss->ns_name)) {
		GRID_WARN("Namespace name too long (given=%"G_GSIZE_FORMAT" max=%u)",
				s, (unsigned int)sizeof(ss->ns_name));
		return FALSE;
	}
	GRID_DEBUG("NS configured to [%s]", ss->ns_name);

	ss->lb_world = oio_lb_local__create_world();
	ss->lb = oio_lb__create();

	s = g_strlcpy(ss->volume, argv[1], sizeof(ss->volume));
	if (s >= sizeof(ss->volume)) {
		GRID_WARN("Volume name too long (given=%"G_GSIZE_FORMAT" max=%u)",
				s, (unsigned int) sizeof(ss->volume));
		return FALSE;
	}
	GRID_DEBUG("Volume configured to [%s]", ss->volume);

	ss->zk_url = gridcluster_get_zookeeper(ss->ns_name);

	return TRUE;
}
开发者ID:carriercomm,项目名称:oio-sds,代码行数:57,代码来源:sqlx_service.c


示例11: monitoring_loop

static void
monitoring_loop(service_info_t *si)
{
	long jiffies = 0;
	GTimer *timer;
	GError *error = NULL;
	guint proc_count;

	timer = g_timer_new();
	monitor_get_status(svc_mon, si);
	_add_custom_tags(si);

	proc_count = supervisor_children_startall(NULL, NULL);
	GRID_DEBUG("First started %u processes", proc_count);

	while (flag_running) { /* main loop */

		if (flag_restart_children) {
			if (auto_restart_children) {
				supervisor_children_repair(CHILD_KEY);
				supervisor_children_enable(CHILD_KEY, TRUE);
				proc_count = supervisor_children_startall(NULL,NULL);

				GRID_DEBUG("Started %u processes", proc_count);
				flag_restart_children = !!proc_count;
			} else {
				GRID_DEBUG("One of my children died, I will die too (auto_restart_children=%d)", auto_restart_children);
				break;
			}
		}

		if (!flag_running)
			break;

		gdouble elapsed = g_timer_elapsed(timer, NULL);
		if (elapsed >= 1.0) {
			if (!((++jiffies) % monitor_period)) {
				monitor_get_status(svc_mon, si);
				_add_custom_tags(si);
			}
			if (!register_namespace_service(si, &error)) {
				GRID_WARN("Failed to register the service: %s", gerror_get_message(error));
				g_clear_error(&error);
			}
			g_timer_reset(timer);
			elapsed = 0.0;
		}

		g_usleep (1000000UL - ((gulong)elapsed));
	}

	supervisor_children_stopall(4);
	supervisor_children_catharsis(NULL, NULL);

	g_free(timer);
}
开发者ID:korween,项目名称:oio-sds,代码行数:56,代码来源:main.c


示例12: hc_list_contents

gs_error_t *
hc_list_contents(gs_grid_storage_t *hc, struct hc_url_s *url, int output_xml, int show_info,
		char **result)
{
	gs_error_t *e = NULL;
	gs_container_t *c = NULL;
	const gchar *snapshot = hc_url_get(url, HCURL_SNAPORVERS);
	struct list_content_s lc;

	c = gs_get_storage_container(hc, hc_url_get(url, HCURL_REFERENCE), NULL, 0, &e);

	if (NULL != c) {
		GRID_DEBUG("%s found\n", hc_url_get(url, HCURL_REFERENCE));

		lc.nb_elts = 0;
		lc.xml = output_xml;
		lc.show_info = show_info;
		lc.buffer = g_string_new("");
		lc.listed = NULL;

		if(output_xml) {
			g_string_append_printf(lc.buffer,
					"<Container>\n"
					" <Name>%s</Name>\n"
					" <Contents>\n",
					hc_url_get(url, HCURL_REFERENCE));
		} else {
			g_string_append_printf(lc.buffer, "#Listing container=[%s]\n", hc_url_get(url, HCURL_REFERENCE));
		}

		if (!gs_list_container_snapshot(c, NULL, _my_content_filter, &lc,
				snapshot, &e)) {
			g_printerr("Cannot list %s\n", hc_url_get(url, HCURL_REFERENCE));
			g_string_free(lc.buffer, TRUE);
		} else {
			_sort_listed(&lc);
			GRID_DEBUG("%s listed\n", hc_url_get(url, HCURL_REFERENCE));
			if(output_xml) {
				lc.buffer = g_string_append(lc.buffer,
					" </Contents>\n"
					"</Container>\n");
			} else {
				g_string_append_printf(lc.buffer, "#Total in [%s]: %i elements\n",
						hc_url_get(url, HCURL_REFERENCE), lc.nb_elts);
			}
			*result = g_string_free(lc.buffer, FALSE);
		}

		gs_container_free(c);
		return e;
	}

	g_printerr("Cannot find %s\n", hc_url_get(url, HCURL_REFERENCE));
	return e;
}
开发者ID:amogrid,项目名称:redcurrant,代码行数:55,代码来源:hc_func.c


示例13: _thread_cb_worker

static gpointer
_thread_cb_worker(gpointer td)
{
	struct grid_stats_holder_s *local_stats = NULL;
	time_t last_update, last_not_idle;
	struct network_server_s *srv = td;

	metautils_ignore_signals();
	_thread_maybe_become_first(srv);
	last_update = last_not_idle = network_server_bogonow(srv);
	local_stats = grid_stats_holder_init();
	GRID_DEBUG("Thread starting for srv %p", srv);

	while (srv->flag_continue || srv->cnx_clients > 0) {
		struct network_client_s *clt = get_next_client(srv);
		if (!clt) {
			gboolean expired = network_server_bogonow(srv) >
				(last_not_idle + srv->workers_max_idle_delay);
			if (expired && _thread_can_die(srv)) {
				GRID_DEBUG("Thread idle for too long, exiting!");
				goto label_exit;
			}
		}
		else { /* something happened */
			EXTRA_ASSERT(clt->server == srv);

			_thread_become_active(srv);
			last_not_idle = network_server_bogonow(srv);
			clt->local_stats = local_stats;
			_work_on_client(srv, clt);
			_thread_become_inactive(srv);
		}

		/* periodically merge the local stats in the main stats */
		if (last_update < network_server_bogonow(srv)) {
			grid_stats_holder_increment_merge(srv->stats, local_stats);
			grid_stats_holder_zero(local_stats);
			last_update = network_server_bogonow(srv);
		}
	}

	/* thread exiting due to a server stop */
	GRID_DEBUG("Thread exiting for srv %p", srv);
	_thread_stop(srv);

label_exit:
	if (local_stats) {
		grid_stats_holder_increment_merge(srv->stats, local_stats);
		grid_stats_holder_clean(local_stats);
	}
	return td;
}
开发者ID:Narthorn,项目名称:oio-sds,代码行数:52,代码来源:network_server.c


示例14: __test_location

static gboolean
__test_location(gchar *loc, GSList *used_loc, gint64 distance)
{
	GRID_DEBUG("Required distance is %ld", distance);
	GSList *l = NULL;
	for (l = used_loc; l && l->data; l = l->next) {
		gint64 d = distance_between_location(loc, (gchar*) l->data);
		GRID_DEBUG("-> found distance %ld", d);
		if(d < distance)
			return FALSE;
	}
	return TRUE;
}
开发者ID:redcurrant,项目名称:redcurrant,代码行数:13,代码来源:content_check.c


示例15: _find_matching_rawx

static service_info_t *
_find_matching_rawx(GSList *rawx, GSList *used_loc, gint64 distance,
		const gchar *stg_class, GSList **rawx_garbage)
{
	GRID_DEBUG("Searching rawx distant of %"G_GINT64_FORMAT
			" with storage class '%s'", distance, stg_class);
	GSList *l = NULL;
	gchar loc[1024];
	struct service_tag_s * loc_tag = NULL;
	GRID_DEBUG("Checking for an available rawx in a list of %d elements",
			g_slist_length(rawx));
	for (l = rawx; l && l->data; l = l->next) {
		GRID_DEBUG("Checking one rawx...");
		/* ensure service score */
		if(((service_info_t*)l->data)->score.value <= 0) {
			GRID_DEBUG("Rawx score <= 0");
			continue;
		}
		/* ensure not spotted as unreachable */
		if(_is_rawx_in_garbage((service_info_t*)l->data, *rawx_garbage)) {
			GRID_DEBUG("Rawx already in unreachable list");
			continue;
		}
		/* check rawx reachable */
		if(!is_rawx_reachable((service_info_t*)l->data)) {
			GRID_DEBUG("Rawx unreachable");
			*rawx_garbage = g_slist_prepend(*rawx_garbage, l->data);
			continue;
		}

		/* check rawx has appropriate storage class (strictly) */
		if (!service_info_check_storage_class(l->data, stg_class)) {
			GRID_DEBUG(MSG_DONT_MATCH_CRITERIA, "storage class");
			continue;
		}

		/* ensure distance match with our policy */
		bzero(loc, sizeof(loc));
		loc_tag = service_info_get_tag(((service_info_t*)l->data)->tags, NAME_TAGNAME_RAWX_LOC);
		GRID_DEBUG("service tag extracted");
		if(!loc_tag) {
			if(distance > 1) {
				continue;
			}
			return ((service_info_t*)l->data);
		}
		service_tag_get_value_string(loc_tag, loc, sizeof(loc), NULL);
		if(__test_location(loc, used_loc, distance)) {
			return ((service_info_t*)l->data);
		} else {
			GRID_DEBUG(MSG_DONT_MATCH_CRITERIA, "distance");
		}
	}
	return NULL;
}
开发者ID:redcurrant,项目名称:redcurrant,代码行数:55,代码来源:content_check.c


示例16: meta2_filter_ctx_get_error

GError *
meta2_filter_ctx_get_error(const struct gridd_filter_ctx_s *ctx)
{
	if(!ctx || !ctx->output_data) {
		GRID_DEBUG("uninitialized pointer : %p", ctx);
		return NULL;
	}
	if(NULL != ctx->output_data->error) {
		GRID_DEBUG("ctx error : %d, %s", ctx->output_data->error->code, ctx->output_data->error->message);
	} else {
		GRID_DEBUG("No error found in context");
	}
	return ctx->output_data->error;
}
开发者ID:InGenious-Justice,项目名称:oio-sds,代码行数:14,代码来源:meta2_filter_context.c


示例17: hc_delete_content

gs_error_t *
hc_delete_content(gs_grid_storage_t *hc, struct hc_url_s *url)
{
	gs_error_t *e = NULL;
	gs_container_t *c = NULL;
	gs_content_t *content = NULL;

	c = gs_get_storage_container(hc, hc_url_get(url, HCURL_REFERENCE),NULL, 0, &e);
	if(NULL != c) {
		const gchar *version = hc_url_get(url, HCURL_VERSION);
		// First try
		content = gs_get_content_from_path_and_version (c, hc_url_get(url, HCURL_PATH), version, &e);
		if (content == NULL && e != NULL && e->code == CODE_CONTENT_NOTFOUND && !version) {
			// Last version is probably marked deleted, so a "get" without
			// version fails. We need to specify we want the latest, even
			// if it's deleted, so we can undelete it.
			version = HCURL_LATEST_VERSION;
			gs_error_free(e);
			e = NULL;
			// Second try
			content = gs_get_content_from_path_and_version (c, hc_url_get(url, HCURL_PATH), version, &e);
		}
		if (NULL != content) {
			if(gs_destroy_content (content, &e)) {
				GRID_DEBUG("Content %s deleted\n", hc_url_get(url, HCURL_PATH));
			}
			gs_content_free(content);
		}
		gs_container_free(c);
	}
	return e;
}
开发者ID:amogrid,项目名称:redcurrant,代码行数:32,代码来源:hc_func.c


示例18: _open_destination

static int
_open_destination(const char *local_path, int force, int *out)
{
	/* Allow everything except execution (umask will apply) */
	mode_t file_perms = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IWOTH|S_IROTH;

	if (!local_path || !g_ascii_strcasecmp(local_path, "-")) {
		*out = 1;
	}
	else {
		*out = open(local_path, O_WRONLY | O_CREAT | (force ? O_TRUNC : O_EXCL),
				file_perms);
		if (-1 == *out) {
			if (errno == ENOENT) {
				*out = open(local_path, O_WRONLY | O_CREAT | O_EXCL, file_perms);
				if (-1 == *out) {
					g_printerr("Cannot create and open the local file %s (%s)\n", local_path,
					    strerror(errno));
					return 0;
				} else {
					g_printerr("Local path %s created\n", local_path);
				}
			} else {
				g_printerr("Cannot open the local file %s (%s)\n", local_path, strerror(errno));
				return 0;
			}
		} else {
			GRID_DEBUG("Local path %s opened\n", local_path);
		}
	}
	return 1;
}
开发者ID:amogrid,项目名称:redcurrant,代码行数:32,代码来源:hc_func.c


示例19: meta1_backend_services_config

GError*
meta1_backend_services_config(struct meta1_backend_s *m1,
                              struct oio_url_s *url, const char *packedurl)
{
    struct meta1_service_url_s *m1url;
    if (!(m1url = meta1_unpack_url(packedurl)))
        return NEWERROR(CODE_BAD_REQUEST, "Invalid URL");

    GRID_DEBUG("About to reconfigure [%s] [%"G_GINT64_FORMAT"] [%s] [%s]",
               m1url->srvtype, m1url->seq, m1url->host, m1url->args);

    struct sqlx_sqlite3_s *sq3 = NULL;
    GError *err = _open_and_lock(m1, url, M1V2_OPENBASE_MASTERONLY, &sq3);
    if (err) {
        g_free(m1url);
        return err;
    }

    struct sqlx_repctx_s *repctx = NULL;
    if (!(err = sqlx_transaction_begin(sq3, &repctx))) {
        if (!(err = __info_user(sq3, url, FALSE, NULL)))
            err = __configure_service(sq3, url, m1url);
        if (!(err = sqlx_transaction_end(repctx, err)))
            __notify_services_by_cid(m1, sq3, url);
    }

    sqlx_repository_unlock_and_close_noerror(sq3);
    g_free(m1url);
    return err;
}
开发者ID:racciari,项目名称:oio-sds,代码行数:30,代码来源:meta1_backend_services.c


示例20: grid_clear_lines

/* Clear lines. This just frees and truncates the lines. */
void
grid_clear_lines(struct grid *gd, u_int py, u_int ny)
{
	struct grid_line	*gl;
	u_int			 yy;

	GRID_DEBUG(gd, "py=%u, ny=%u", py, ny);

	if (ny == 0)
		return;

	if (grid_check_y(gd, py) != 0)
		return;
	if (grid_check_y(gd, py + ny - 1) != 0)
		return;

	for (yy = py; yy < py + ny; yy++) {
		gl = &gd->linedata[yy];
		if (gl->celldata != NULL)
			xfree(gl->celldata);
		if (gl->utf8data != NULL)
			xfree(gl->utf8data);
		memset(gl, 0, sizeof *gl);
	}
}
开发者ID:ThomasAdam,项目名称:tmux-cvs-archived,代码行数:26,代码来源:grid.c



注:本文中的GRID_DEBUG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GRID_WARN函数代码示例发布时间:2022-05-30
下一篇:
C++ GRETH_REGSAVE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap