log: remove app path from syslog id
authorThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 16 Sep 2013 10:36:20 +0000 (12:36 +0200)
committerDavid Marchand <david.marchand@6wind.com>
Wed, 26 Feb 2014 10:01:14 +0000 (11:01 +0100)
This reverts commit "log: get full path as syslog id" (494a02537f1)
and restore the original patch from Stephen Hemminger (04210699eee).

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
lib/librte_eal/linuxapp/eal/eal.c

index d572bda..76c2f3c 100644 (file)
@@ -931,10 +931,14 @@ rte_eal_init(int argc, char **argv)
        pthread_t thread_id;
        static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
        struct shared_driver *solib = NULL;
+       const char *logid;
 
        if (!rte_atomic32_test_and_set(&run_once))
                return -1;
 
+       logid = strrchr(argv[0], '/');
+       logid = strdup(logid ? logid + 1: argv[0]);
+
        thread_id = pthread_self();
 
        if (rte_eal_log_early_init() < 0)
@@ -1003,7 +1007,7 @@ rte_eal_init(int argc, char **argv)
                rte_panic("Cannot init IVSHMEM objects\n");
 #endif
 
-       if (rte_eal_log_init(argv[0], internal_config.syslog_facility) < 0)
+       if (rte_eal_log_init(logid, internal_config.syslog_facility) < 0)
                rte_panic("Cannot init logs\n");
 
        if (rte_eal_alarm_init() < 0)