examples: fix port mask parsing failure handling
[dpdk.git] / examples / l2fwd-keepalive / main.c
index b7585d5..35d10e5 100644 (file)
@@ -160,6 +160,8 @@ print_stats(__rte_unused struct rte_timer *ptr_timer,
                   total_packets_rx,
                   total_packets_dropped);
        printf("\n====================================================\n");
+
+       fflush(stdout);
 }
 
 static void
@@ -305,10 +307,7 @@ l2fwd_parse_portmask(const char *portmask)
        /* parse hexadecimal string */
        pm = strtoul(portmask, &end, 16);
        if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
-               return -1;
-
-       if (pm == 0)
-               return -1;
+               return 0;
 
        return pm;
 }