Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] zbd: Fix build errors on Windows and MacOS
@ 2020-04-08  1:54 Damien Le Moal
  2020-04-08  2:21 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Damien Le Moal @ 2020-04-08  1:54 UTC (permalink / raw)
  To: fio, Jens Axboe, Vincent Fu

Including dirent.h is not needed, so remove it to avoid a compilation
error on Windows and MacOS. Also make sure that EREMOTEIO is defined as
some OSes do not have this error code.

Fixes: b76949618d55 ("fio: Generalize zonemode=zbd")
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 zbd.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/zbd.c b/zbd.c
index 2a324d34..f4067802 100644
--- a/zbd.c
+++ b/zbd.c
@@ -7,7 +7,6 @@
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
-#include <dirent.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -1235,6 +1234,13 @@ static void zbd_put_io(const struct io_u *io_u)
 	zbd_check_swd(f);
 }
 
+/*
+ * Windows and MacOS do not define this.
+ */
+#ifndef EREMOTEIO
+#define EREMOTEIO	121	/* POSIX value */
+#endif
+
 bool zbd_unaligned_write(int error_code)
 {
 	switch (error_code) {
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] zbd: Fix build errors on Windows and MacOS
  2020-04-08  1:54 [PATCH] zbd: Fix build errors on Windows and MacOS Damien Le Moal
@ 2020-04-08  2:21 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-04-08  2:21 UTC (permalink / raw)
  To: Damien Le Moal, fio, Vincent Fu

On 4/7/20 6:54 PM, Damien Le Moal wrote:
> Including dirent.h is not needed, so remove it to avoid a compilation
> error on Windows and MacOS. Also make sure that EREMOTEIO is defined as
> some OSes do not have this error code.

Applied, thanks.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-08  2:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-08  1:54 [PATCH] zbd: Fix build errors on Windows and MacOS Damien Le Moal
2020-04-08  2:21 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox