-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path0001-compile-ok.patch
More file actions
70 lines (63 loc) · 1.96 KB
/
0001-compile-ok.patch
File metadata and controls
70 lines (63 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 8e3150546d6732c803b42477363964530d17038f Mon Sep 17 00:00:00 2001
From: zhanghua <zhanghua@qti.qualcomm.com>
Date: Fri, 8 Aug 2014 13:17:00 +0800
Subject: [PATCH] compile ok
---
engines/net.c | 6 +++---
file.h | 23 +++++++++++++++++++++++
2 files changed, 26 insertions(+), 3 deletions(-)
mode change 100644 => 100755 file.h
diff --git a/engines/net.c b/engines/net.c
index 8087207..1e12134 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -218,12 +218,12 @@ static int poll_wait(struct thread_data *td, int fd, short events)
static int fio_netio_is_multicast(const char *mcaddr)
{
- in_addr_t addr = inet_network(mcaddr);
+ in_addr_t addr = inet_addr(mcaddr);
if (addr == -1)
return 0;
- if (inet_network("224.0.0.0") <= addr &&
- inet_network("239.255.255.255") >= addr)
+ if (inet_addr("224.0.0.0") <= addr &&
+ inet_addr("239.255.255.255") >= addr)
return 1;
return 0;
diff --git a/file.h b/file.h
old mode 100644
new mode 100755
index add7773..8f9396d
--- a/file.h
+++ b/file.h
@@ -9,6 +9,29 @@
#include "lib/axmap.h"
#include "lib/lfsr.h"
+/* Swap bytes in 16 bit value. */
+#define __bswap_16(x) \
+ ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+
+
+/* Swap bytes in 32 bit value. */
+#define __bswap_32(x) \
+ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
+ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
+
+
+/* Swap bytes in 64 bit value. */
+#define __bswap_64(x) \
+ ((((x) & 0xff00000000000000ull) >> 56) \
+ | (((x) & 0x00ff000000000000ull) >> 40) \
+ | (((x) & 0x0000ff0000000000ull) >> 24) \
+ | (((x) & 0x000000ff00000000ull) >> 8) \
+ | (((x) & 0x00000000ff000000ull) << 8) \
+ | (((x) & 0x0000000000ff0000ull) << 24) \
+ | (((x) & 0x000000000000ff00ull) << 40) \
+ | (((x) & 0x00000000000000ffull) << 56))
+
+
/*
* The type of object we are working on
*/
--
2.0.2.673.g9ab0882