[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 2/9] src: launch: cast the sockaddr args to sockaddr*



This matches what generally done for passing socket addresses to e.g.
socket and bind, and already done in other parts of libguestfs.
---
 src/launch-direct.c  | 3 ++-
 src/launch-libvirt.c | 5 +++--
 src/launch-unix.c    | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/launch-direct.c b/src/launch-direct.c
index 021df94..d81dcd7 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -341,7 +341,8 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
   strncpy (addr.sun_path, guestfsd_sock, UNIX_PATH_MAX);
   addr.sun_path[UNIX_PATH_MAX-1] = '\0';
 
-  if (bind (daemon_accept_sock, &addr, sizeof addr) == -1) {
+  if (bind (daemon_accept_sock, (struct sockaddr *) &addr,
+            sizeof addr) == -1) {
     perrorf (g, "bind");
     goto cleanup0;
   }
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 26d3202..1f3c451 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -404,7 +404,8 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
   addr.sun_family = AF_UNIX;
   memcpy (addr.sun_path, params.guestfsd_path, UNIX_PATH_MAX);
 
-  if (bind (daemon_accept_sock, &addr, sizeof addr) == -1) {
+  if (bind (daemon_accept_sock, (struct sockaddr *) &addr,
+            sizeof addr) == -1) {
     perrorf (g, "bind");
     goto cleanup;
   }
@@ -428,7 +429,7 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
   addr.sun_family = AF_UNIX;
   memcpy (addr.sun_path, params.console_path, UNIX_PATH_MAX);
 
-  if (bind (console_sock, &addr, sizeof addr) == -1) {
+  if (bind (console_sock, (struct sockaddr *) &addr, sizeof addr) == -1) {
     perrorf (g, "bind");
     goto cleanup;
   }
diff --git a/src/launch-unix.c b/src/launch-unix.c
index c5e4438..ac165a8 100644
--- a/src/launch-unix.c
+++ b/src/launch-unix.c
@@ -63,7 +63,7 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath)
 
   g->state = LAUNCHING;
 
-  if (connect (daemon_sock, &addr, sizeof addr) == -1) {
+  if (connect (daemon_sock, (struct sockaddr *) &addr, sizeof addr) == -1) {
     perrorf (g, "bind");
     goto cleanup;
   }
-- 
1.9.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]