Bugfix for the parsing of flags. Backwards compatibility for direct IO.

master
Julian M. Kunkel 2019-04-02 12:08:31 +01:00
parent 21405ed924
commit 07217c93aa
4 changed files with 13 additions and 3 deletions

View File

@ -306,6 +306,7 @@ void *POSIX_Create(char *testFileName, IOR_param_t * param)
ERR("Unable to malloc file descriptor");
posix_options_t * o = (posix_options_t*) param->backend_options;
if (o->direct_io == TRUE){
printf("ODIREC\n");
set_o_direct_flag(&fd_oflag);
}

View File

@ -223,6 +223,7 @@ void option_print_current(option_help * args){
static void option_parse_token(char ** argv, int * flag_parsed_next, int * requiredArgsSeen, options_all_t * opt_all, int * error, int * print_help){
char * txt = argv[0];
char * arg = strstr(txt, "=");
int replaced_equal = 0;
int i = 0;
if(arg != NULL){
@ -338,12 +339,14 @@ static void option_parse_token(char ** argv, int * flag_parsed_next, int * requi
}
}
int option_parse_key_value(char * key, char * value, options_all_t * opt_all){
int option_parse_key_value(char * key, char *val, options_all_t * opt_all){
int flag_parsed_next;
char * argv[2] = {key, value};
int error = 0;
int requiredArgsSeen = 0;
int print_help = 0;
char value[1024];
sprintf(value, "%s=%s", key, val);
char * argv[2] = {value, NULL};
option_parse_token(argv, & flag_parsed_next, & requiredArgsSeen, opt_all, & error, & print_help);
return error;
}

View File

@ -291,6 +291,10 @@ void DecodeDirective(char *line, IOR_param_t *params, options_all_t * module_opt
} else if (strcasecmp(option, "summaryalways") == 0) {
params->summary_every_test = atoi(value);
} else {
// backward compatibility for now
if (strcasecmp(option, "useo_direct") == 0) {
strcpy(option, "--posix.odirect");
}
int parsing_error = option_parse_key_value(option, value, module_options);
if(parsing_error){
if (rank == 0)
@ -410,7 +414,7 @@ IOR_test_t *ReadConfigScript(char *scriptName)
tail->next = CreateTest(&tail->params, test_num++);
AllocResults(tail);
((IOR_test_t*) tail)->params.backend_options = airoi_update_module_options(((IOR_test_t*) tail)->params.backend, global_options);
tail = tail->next;
*option_p = createGlobalOptions(& ((IOR_test_t*) tail->next)->params);
}

View File

@ -15,5 +15,7 @@ blockSize=100k
# space-prefixed comment
run
--dummy.delay-create=1000
useo_direct=0
#--posix.odirect=0
api=dummy
ior stop