projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use ARRAY_SIZE() for ignore_error_nr[etype]
[fio.git]
/
options.c
diff --git
a/options.c
b/options.c
index 2daa983e0d9b2ef1002bd10ed6156fe8e5ba486f..6d799bfe0e67871f5b3345148f0cc525a5624916 100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-270,7
+270,8
@@
static int str2error(char *str)
return 0;
}
return 0;
}
-static int ignore_error_type(struct thread_data *td, int etype, char *str)
+static int ignore_error_type(struct thread_data *td, enum error_type_bit etype,
+ char *str)
{
unsigned int i;
int *error;
{
unsigned int i;
int *error;
@@
-282,7
+283,7
@@
static int ignore_error_type(struct thread_data *td, int etype, char *str)
}
td->o.ignore_error_nr[etype] = 4;
}
td->o.ignore_error_nr[etype] = 4;
- error =
malloc(4 * sizeof(struct bsspli
t));
+ error =
calloc(4, sizeof(in
t));
i = 0;
while ((fname = strsep(&str, ":")) != NULL) {
i = 0;
while ((fname = strsep(&str, ":")) != NULL) {
@@
-306,8
+307,9
@@
static int ignore_error_type(struct thread_data *td, int etype, char *str)
error[i] = -error[i];
}
if (!error[i]) {
error[i] = -error[i];
}
if (!error[i]) {
- log_err("Unknown error %s, please use number value
\n",
+ log_err("Unknown error %s, please use number value\n",
fname);
fname);
+ td->o.ignore_error_nr[etype] = 0;
free(error);
return 1;
}
free(error);
return 1;
}
@@
-317,8
+319,10
@@
static int ignore_error_type(struct thread_data *td, int etype, char *str)
td->o.continue_on_error |= 1 << etype;
td->o.ignore_error_nr[etype] = i;
td->o.ignore_error[etype] = error;
td->o.continue_on_error |= 1 << etype;
td->o.ignore_error_nr[etype] = i;
td->o.ignore_error[etype] = error;
- } else
+ } else {
+ td->o.ignore_error_nr[etype] = 0;
free(error);
free(error);
+ }
return 0;
return 0;
@@
-328,7
+332,8
@@
static int str_ignore_error_cb(void *data, const char *input)
{
struct thread_data *td = cb_data_to_td(data);
char *str, *p, *n;
{
struct thread_data *td = cb_data_to_td(data);
char *str, *p, *n;
- int type = 0, ret = 1;
+ int ret = 1;
+ enum error_type_bit type = 0;
if (parse_dryrun())
return 0;
if (parse_dryrun())
return 0;