examples/packet_ordering: use proper exit method
authorSarosh Arif <sarosh.arif@emumba.com>
Fri, 5 Jun 2020 11:48:28 +0000 (16:48 +0500)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 30 Jul 2020 21:36:39 +0000 (23:36 +0200)
rte_exit should be called when the application exits due to
invalid EAL or application arguments.

Fixes: 850f3733f840 ("examples/packet_ordering: new sample app")

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
examples/packet_ordering/main.c

index 5c654c1..b5fc6c5 100644 (file)
@@ -672,7 +672,7 @@ main(int argc, char **argv)
        /* Initialize EAL */
        ret = rte_eal_init(argc, argv);
        if (ret < 0)
-               return -1;
+               rte_exit(EXIT_FAILURE, "Invalid EAL arguments\n");
 
        argc -= ret;
        argv += ret;
@@ -680,7 +680,7 @@ main(int argc, char **argv)
        /* Parse the application specific arguments */
        ret = parse_args(argc, argv);
        if (ret < 0)
-               return -1;
+               rte_exit(EXIT_FAILURE, "Invalid packet_ordering arguments\n");
 
        /* Check if we have enought cores */
        if (rte_lcore_count() < 3)