[libvirt PATCH v2 13/56] src: only import sys/uio.h when journald is built

Daniel P. Berrangé posted 56 patches 6 years ago
There is a newer version of this series
[libvirt PATCH v2 13/56] src: only import sys/uio.h when journald is built
Posted by Daniel P. Berrangé 6 years ago
The sys/uio.h header is only needed when building logging
code with journald support enabled. Conditionally include
it so that we avoid break on platforms which lack this
header.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/util/virlog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virlog.c b/src/util/virlog.c
index ddc3ac1edb..8c17d666de 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -28,7 +28,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <sys/uio.h>
 #if HAVE_SYSLOG_H
 # include <syslog.h>
 #endif
@@ -52,6 +51,7 @@
  * htole64.  */
 #if HAVE_SYSLOG_H && defined(__linux__) && HAVE_DECL_HTOLE64
 # define USE_JOURNALD 1
+# include <sys/uio.h>
 #endif
 
 #define VIR_FROM_THIS VIR_FROM_NONE
-- 
2.24.1

Re: [libvirt PATCH v2 13/56] src: only import sys/uio.h when journald is built
Posted by Pavel Hrdina 6 years ago
On Tue, Jan 28, 2020 at 01:10:54PM +0000, Daniel P. Berrangé wrote:
> The sys/uio.h header is only needed when building logging
> code with journald support enabled. Conditionally include
> it so that we avoid break on platforms which lack this
> header.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/util/virlog.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>