X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Frc.c;h=a9eb5788fc0b9fc4970d81a9cf5af25ce911ff6a;hp=5d64c709704ecef600672d76b189400222809fb1;hb=c9d94984588d166bcdc077a7972a1b454678ba10;hpb=d5b89d36224b394391af09fba7ed0a7921175610 diff --git a/fish/rc.c b/fish/rc.c index 5d64c70..a9eb578 100644 --- a/fish/rc.c +++ b/fish/rc.c @@ -98,7 +98,8 @@ receive_stdout (int s) else { /* Extract the transferred file descriptor from the control data */ - int fd = *(int *)CMSG_DATA (h); + unsigned char *data = CMSG_DATA (h); + int fd = *(int *)data; /* Duplicate the received file descriptor to stdout */ dup2 (fd, STDOUT_FILENO); @@ -146,7 +147,8 @@ send_stdout (int s) msg.msg_controllen = controllen; /* Add STDOUT to the control data */ - *(int *)CMSG_DATA (cmptr) = STDOUT_FILENO; + unsigned char *data = CMSG_DATA (cmptr); + *(int *)data = STDOUT_FILENO; if (sendmsg (s, &msg, 0) != 1) { perror ("sendmsg stdout fd"); @@ -248,7 +250,7 @@ rc_listen (void) goto error; } - if (strcmp (hello.vers, PACKAGE_VERSION) != 0) { + if (STRNEQ (hello.vers, PACKAGE_VERSION)) { fprintf (stderr, _("guestfish: protocol error: version mismatch, server version '%s' does not match client version '%s'. The two versions must match exactly.\n"), PACKAGE_VERSION, hello.vers);