aboutsummaryrefslogtreecommitdiff
path: root/test/shutdown.c
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:04:01 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:04:01 +0000
commit821578a500691b0c438599fa18e664534aee1ebe (patch)
treeebe9c872e416346e4b333e5062da32401c8e0a73 /test/shutdown.c
parentd53db6851ea17b2d219d084e1afc683b8b62b105 (diff)
parent1d27ff1934c5c4292dc00fba7f7f8ae411ed42f5 (diff)
downloadliburing-821578a500691b0c438599fa18e664534aee1ebe.tar.gz
Change-Id: Iea5b067f051d3000a8529c5712d506aea8f25919
Diffstat (limited to 'test/shutdown.c')
-rw-r--r--test/shutdown.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/shutdown.c b/test/shutdown.c
index 5aa1371..14c7407 100644
--- a/test/shutdown.c
+++ b/test/shutdown.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include <assert.h>
#include <errno.h>
@@ -15,6 +16,7 @@
#include <sys/un.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include "liburing.h"
@@ -42,8 +44,8 @@ int main(int argc, char *argv[])
assert(ret != -1);
addr.sin_family = AF_INET;
- addr.sin_port = (rand() % 61440) + 4096;
- addr.sin_addr.s_addr = 0x0100007fU;
+ addr.sin_port = htons((rand() % 61440) + 4096);
+ addr.sin_addr.s_addr = inet_addr("127.0.0.1");
ret = bind(recv_s0, (struct sockaddr*)&addr, sizeof(addr));
assert(ret != -1);