]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: only import sys/uio.h when journald is built
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 22 Jan 2020 11:49:45 +0000 (11:49 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 29 Jan 2020 14:51:40 +0000 (14:51 +0000)
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.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virlog.c

index ddc3ac1edb5fc1726aac2899e5703751b8cf9a7a..8c17d666deecd3505f66b428a8d9b412f8a85c54 100644 (file)
@@ -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