poll: break on EINTR without complaining
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 25de29e2a84eb51605562b355869d3006bdec632..239e37141c0fb5be468d9f841844c0ca4c64ba19 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -187,6 +187,7 @@ static unsigned long long get_mult_bytes(const char *str, int len, void *data,
                                         int *percent)
 {
        const char *p = str;
+       int digit_seen = 0;
 
        if (len < 2)
                return __get_mult_bytes(str, data, percent);
@@ -195,8 +196,10 @@ static unsigned long long get_mult_bytes(const char *str, int len, void *data,
          * Go forward until we hit a non-digit, or +/- sign
          */
        while ((p - str) <= len) {
-               if (!isdigit((int) *p) && (*p != '+') && (*p != '-'))
+               if (!isdigit((int) *p) &&
+                   (((*p != '+') && (*p != '-')) || digit_seen))
                        break;
+               digit_seen |= isdigit((int) *p);
                p++;
        }
 
@@ -489,8 +492,10 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 
                posval_sort(o, posval);
 
-               if (!o->posval[0].ival)
+               if (!o->posval[0].ival) {
+                       vp = NULL;
                        goto match;
+               }
 
                ret = 1;
                for (i = 0; i < PARSE_MAX_VP; i++) {
@@ -514,7 +519,7 @@ match:
                                if (rest) {
                                        *rest = '\0';
                                        ptr = rest + 1;
-                               } else
+                               } else if (vp && vp->cb)
                                        ptr = NULL;
                                break;
                        }