[Libguestfs] [PATCH libnbd 1/2] states: Don't assume socket address family is always AF_UNIX.
Richard W.M. Jones
rjones at redhat.com
Fri Oct 18 15:39:12 UTC 2019
Get the address family from h->connaddr instead.
This should make no difference to existing code.
---
generator/states-connect.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/generator/states-connect.c b/generator/states-connect.c
index 04e894c..d62b0f5 100644
--- a/generator/states-connect.c
+++ b/generator/states-connect.c
@@ -51,7 +51,8 @@ STATE_MACHINE {
int fd;
assert (!h->sock);
- fd = socket (AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
+ fd = socket (h->connaddr.ss_family,
+ SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
if (fd == -1) {
SET_NEXT_STATE (%.DEAD);
set_error (errno, "socket");
--
2.23.0
More information about the Libguestfs
mailing list