[libvirt] [PATCH v2] util: move ENODATA redefine to internal.h

FreeBSD lacks ENODATA, and viruuid.c redefines it to EIO, but it's not actually using it. On the other hand, we have virrandom.c that's using ENODATA. So make this re-definition common by moving it to internal.h, so all the current and possible future users don't need to care about that. --- src/internal.h | 4 ++++ src/util/viruuid.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/internal.h b/src/internal.h index db26fb0..9ebaf3c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -517,4 +517,8 @@ enum { EXIT_ENOENT = 127, /* Could not find program to exec */ }; +# ifndef ENODATA +# define ENODATA EIO +# endif + #endif /* __VIR_INTERNAL_H__ */ diff --git a/src/util/viruuid.c b/src/util/viruuid.c index 1fcc954..16e57db 100644 --- a/src/util/viruuid.c +++ b/src/util/viruuid.c @@ -46,10 +46,6 @@ VIR_LOG_INIT("util.uuid"); -#ifndef ENODATA -# define ENODATA EIO -#endif - static unsigned char host_uuid[VIR_UUID_BUFLEN]; static int -- 2.7.4

On Fri, 2016-04-08 at 10:23 +0300, Roman Bogorodskiy wrote:
FreeBSD lacks ENODATA, and viruuid.c redefines it to EIO, but it's not actually using it. On the other hand, we have virrandom.c that's using ENODATA. So make this re-definition common by moving it to internal.h, so all the current and possible future users don't need to care about that. --- src/internal.h | 4 ++++ src/util/viruuid.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
ACK -- Andrea Bolognani Software Engineer - Virtualization Team

Andrea Bolognani wrote:
On Fri, 2016-04-08 at 10:23 +0300, Roman Bogorodskiy wrote:
FreeBSD lacks ENODATA, and viruuid.c redefines it to EIO, but it's not actually using it. On the other hand, we have virrandom.c that's using ENODATA. So make this re-definition common by moving it to internal.h, so all the current and possible future users don't need to care about that. --- src/internal.h | 4 ++++ src/util/viruuid.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
ACK
Pushed, thanks! Roman Bogorodskiy
participants (2)
-
Andrea Bolognani
-
Roman Bogorodskiy