Code

dpdkstat: Fixed issue with unused var when configured w/o debug
authorTaras Chornyi <tarasx.chornyi@intel.com>
Thu, 22 Sep 2016 10:22:40 +0000 (11:22 +0100)
committerTaras Chornyi <tarasx.chornyi@intel.com>
Thu, 22 Sep 2016 10:22:40 +0000 (11:22 +0100)
Signed-off-by: Taras Chornyi <tarasx.chornyi@intel.com>
src/dpdkstat.c

index 584254377b0f5454f3abdd253c2afabecbf17773..dc3e7dfd4b58e749f29e954a9e79b58ce6556156 100644 (file)
@@ -147,12 +147,14 @@ static void dpdk_config_init_default(void) {
 
 static int dpdk_config(oconfig_item_t *ci) {
   int port_counter = 0;
-  char errbuf[ERR_BUF_SIZE];
   /* Allocate g_configuration and
    * initialize a POSIX SHared Memory (SHM) object.
    */
   int err = dpdk_shm_init(sizeof(dpdk_config_t));
   if (err) {
+#if COLLECT_DEBUG
+    char errbuf[ERR_BUF_SIZE];
+#endif
     DEBUG("dpdkstat: error in shm_init, %s",
           sstrerror(errno, errbuf, sizeof(errbuf)));
     return -1;