]> git.droids-corp.org - dpdk.git/commitdiff
examples/vm_power: drop Unix path limit redefinition
authorThomas Monjalon <thomas@monjalon.net>
Wed, 20 May 2020 08:10:50 +0000 (10:10 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 21 May 2020 13:41:49 +0000 (15:41 +0200)
The Unix socket path may be as long as UNIX_PATH_MAX.
This constant is supposed to be defined in sys/un.h.
On Linux, it appears to be in linux/un.h.

This constant was re-defined locally, based on a variable declaration.
It is breaking compilation with -fno-common (default in GCC 10)
We could avoid the variable declaration by using NULL struct,
but it looks simpler not redefining this system constant.

As the power library and its examples are restricted to Linux only,
the Linux header file is directly included.

Fixes: 0d74597c1b4f ("examples/vm_power: fix max length of unix socket path")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
examples/vm_power_manager/channel_manager.c
examples/vm_power_manager/channel_manager.h
examples/vm_power_manager/power_manager.c

index 4d136972089afcf928a4352afad6c67a41f2062d..74a2a677e8f577ee3cdb639d6bb056fe4cc71308 100644 (file)
@@ -4,7 +4,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/un.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <inttypes.h>
index a2a2f2bba06d6f49c1481220d437f2e1cb48dc6e..e55376fcdbb153c9e3b42eeca83491c3d8836391 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 #endif
 
 #include <linux/limits.h>
-#include <sys/un.h>
+#include <linux/un.h>
 #include <rte_atomic.h>
 #include <stdbool.h>
 
@@ -26,11 +26,6 @@ extern "C" {
 /* FIFO file name template */
 #define CHANNEL_MGR_FIFO_PATTERN_NAME   "fifo"
 
-#ifndef UNIX_PATH_MAX
-struct sockaddr_un _sockaddr_un;
-#define UNIX_PATH_MAX sizeof(_sockaddr_un.sun_path)
-#endif
-
 #define MAX_CLIENTS 64
 #define MAX_VCPUS 20
 
index 7b4f4b3c4dfaeabc189f90e90aaf771a40c4a3b7..cd51d4741f6cc07a968935d4dcaf237a2f37ee70 100644 (file)
@@ -6,7 +6,6 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/un.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <dirent.h>