[PATCH] Change O_DIRECT vs buffered setup
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 1e709ddbcb0dda56383ed557954e83d388aed3c1..81ffb741094b2ebec9b24e18dff062af2bceced3 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -56,8 +56,8 @@ static int str_to_decimal(const char *str, long long *val, int kilo)
        if (!len)
                return 1;
 
-       *val = strtoul(str, NULL, 10);
-       if (*val == ULONG_MAX && errno == ERANGE)
+       *val = strtol(str, NULL, 10);
+       if (*val == LONG_MAX && errno == ERANGE)
                return 1;
 
        if (kilo)
@@ -132,6 +132,8 @@ static struct fio_option *find_option(struct fio_option *options,
        while (o->name) {
                if (!strcmp(o->name, opt))
                        return o;
+               else if (o->alias && !strcmp(o->alias, opt))
+                       return o;
 
                o++;
        }
@@ -265,6 +267,9 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                        return 1;
                }
 
+               if (o->neg)
+                       il = !il;
+
                if (fn)
                        ret = fn(data, &il);
                else {