net: coerce the result of htonl before printing
authorSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 19 Aug 2020 20:57:05 +0000 (21:57 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 12 Sep 2020 10:05:38 +0000 (11:05 +0100)
Technically htonl() returns a long on Windows
(https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-htonl
) which upsets clang.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
engines/net.c

index 91f25774690a16ec9e20576ebb95e3e4e2e9f82e..c6cec5845aac48a3a8643b88c89b5f27fcdb8995 100644 (file)
@@ -938,8 +938,9 @@ static int fio_netio_udp_recv_open(struct thread_data *td, struct fio_file *f)
 
        if (ntohl(msg.magic) != FIO_LINK_OPEN_CLOSE_MAGIC ||
            ntohl(msg.cmd) != FIO_LINK_OPEN) {
-               log_err("fio: bad udp open magic %x/%x\n", ntohl(msg.magic),
-                                                               ntohl(msg.cmd));
+               log_err("fio: bad udp open magic %x/%x\n",
+                       (unsigned int) ntohl(msg.magic),
+                       (unsigned int) ntohl(msg.cmd));
                return -1;
        }