git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8444
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
gras_msg_handleall(5); /* friends, we're ready. Come and play */
if (xbt_dynar_length(group) < 2) {
gras_msg_handleall(5); /* friends, we're ready. Come and play */
if (xbt_dynar_length(group) < 2) {
- char *msg;
- asprintf(&msg, "Not enough peers arrived. Expected 2 got %ld",
- xbt_dynar_length(group));
+ CRITICAL1("Not enough peers arrived. Expected 2 got %ld",
+ xbt_dynar_length(group));
amok_pm_group_shutdown("bandwidth");
amok_pm_group_shutdown("bandwidth");
}
h1 = *(xbt_peer_t *) xbt_dynar_get_ptr(group, 0);
h2 = *(xbt_peer_t *) xbt_dynar_get_ptr(group, 1);
}
h1 = *(xbt_peer_t *) xbt_dynar_get_ptr(group, 0);
h2 = *(xbt_peer_t *) xbt_dynar_get_ptr(group, 1);
if (argc == 3) {
create = 1;
} else {
if (argc == 3) {
create = 1;
} else {
- asprintf(&other_host, "%s", argv[3]);
+ other_host = xbt_strdup(argv[3]);
other_port = atoi(argv[4]);
}
other_port = atoi(argv[4]);
}
char *buffname;
gras_datadesc_type_t res;
char *buffname;
gras_datadesc_type_t res;
- asprintf(&buffname, "s_xbt_dynar_of_%s", elm_t->name);
+ if (asprintf(&buffname, "s_xbt_dynar_of_%s", elm_t->name) == -1)
+ xbt_die("asprintf failed");
res = gras_datadesc_struct(buffname);
res = gras_datadesc_struct(buffname);
/* build a ref to it */
free(buffname);
/* build a ref to it */
free(buffname);
- asprintf(&buffname, "xbt_dynar_of_%s", elm_t->name);
+ if (asprintf(&buffname, "xbt_dynar_of_%s", elm_t->name) == -1)
+ xbt_die("asprintf failed");
res = gras_datadesc_ref(buffname, res);
free(buffname);
return res;
res = gras_datadesc_ref(buffname, res);
free(buffname);
return res;
char *buffname;
gras_datadesc_type_t res;
char *buffname;
gras_datadesc_type_t res;
- asprintf(&buffname, "s_xbt_matrix_t(%s)", elm_t->name);
+ if (asprintf(&buffname, "s_xbt_matrix_t(%s)", elm_t->name) == -1)
+ xbt_die("asprintf failed");
res = gras_datadesc_struct(buffname);
gras_datadesc_struct_append(res, "lines",
res = gras_datadesc_struct(buffname);
gras_datadesc_struct_append(res, "lines",
/* build a ref to it */
free(buffname);
/* build a ref to it */
free(buffname);
- asprintf(&buffname, "xbt_matrix_t(%s)", elm_t->name);
+ if (asprintf(&buffname, "xbt_matrix_t(%s)", elm_t->name) == -1)
+ xbt_die("asprintf failed");
res = gras_datadesc_ref(buffname, res);
free(buffname);
return res;
res = gras_datadesc_ref(buffname, res);
free(buffname);
return res;
xbt_swag_foreach(process, simix_global->process_list) {
char *who, *who2;
xbt_swag_foreach(process, simix_global->process_list) {
char *who, *who2;
- asprintf(&who, "%s on %s: %s",
- process->name,
- process->smx_host->name,
- (process->blocked) ? "[BLOCKED] "
- : ((process->suspended) ? "[SUSPENDED] " : ""));
+ if (asprintf(&who, "%s on %s: %s",
+ process->name,
+ process->smx_host->name,
+ (process->blocked) ? "[BLOCKED] "
+ : ((process->suspended) ? "[SUSPENDED] " : "")) == -1)
+ xbt_die("asprintf failed");
if (process->mutex) {
who2 =
if (process->mutex) {
who2 =
xbt_strbuff_append(buff, loc_buff);
xbt_strbuff_append(buff, loc_buff);
- vasprintf(&p, fmt, ev->ap_copy);
+ if (vasprintf(&p, fmt, ev->ap_copy) == -1)
+ xbt_die("vasprintf failed");
xbt_strbuff_append(buff, p);
free(p);
xbt_strbuff_append(buff, p);
free(p);