A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finally beat the communication failure leaks of MSG
[simgrid.git]
/
tools
/
tesh
/
run_context.c
diff --git
a/tools/tesh/run_context.c
b/tools/tesh/run_context.c
index
41af0d5
..
b593904
100644
(file)
--- a/
tools/tesh/run_context.c
+++ b/
tools/tesh/run_context.c
@@
-302,6
+302,9
@@
void rctx_pushline(const char *filepos, char kind, char *line)
rctx->cmd = xbt_strdup(line);
rctx->filepos = xbt_strdup(filepos);
rctx->cmd = xbt_strdup(line);
rctx->filepos = xbt_strdup(filepos);
+ if(option){
+ rctx->cmd = bprintf("%s %s",rctx->cmd,option);
+ }
INFO3("[%s] %s%s", filepos, rctx->cmd,
((rctx->is_background) ? " (background command)" : ""));
INFO3("[%s] %s%s", filepos, rctx->cmd,
((rctx->is_background) ? " (background command)" : ""));
@@
-342,6
+345,9
@@
void rctx_pushline(const char *filepos, char kind, char *line)
filepos, rctx->expected_return);
} else if (!strncmp(line, "output sort", strlen("output sort"))) {
filepos, rctx->expected_return);
} else if (!strncmp(line, "output sort", strlen("output sort"))) {
+ sort_len = atoi(line + strlen("output sort"));
+ if (sort_len==0)
+ sort_len=SORT_LEN_DEFAULT;
rctx->output_sort = 1;
VERB1("[%s] (sort output of next command)", filepos);
rctx->output_sort = 1;
VERB1("[%s] (sort output of next command)", filepos);
@@
-650,7
+656,7
@@
static int cmpstringp(const void *p1, const void *p2) {
DEBUG2("Compare strings '%s' and '%s'", s1, s2);
DEBUG2("Compare strings '%s' and '%s'", s1, s2);
- int res = strncmp(s1, s2,
19
);
+ int res = strncmp(s1, s2,
sort_len
);
if (res == 0)
return p1>p2;
return res;
if (res == 0)
return p1>p2;
return res;
@@
-799,7
+805,6
@@
void *rctx_wait(void *r)
xbt_dynar_free(&a);
/* If an empty line moved in first position, move it back to the end */
if (rctx->output_got->data[0]=='\n') {
xbt_dynar_free(&a);
/* If an empty line moved in first position, move it back to the end */
if (rctx->output_got->data[0]=='\n') {
- fprintf(stderr,"XXX");
memmove(rctx->output_got->data,rctx->output_got->data+1,rctx->output_got->used-1);
rctx->output_got->data[rctx->output_got->used-1] = '\n';
}
memmove(rctx->output_got->data,rctx->output_got->data+1,rctx->output_got->used-1);
rctx->output_got->data[rctx->output_got->used-1] = '\n';
}