]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: fix include path for cygwin
authorEric Blake <eblake@redhat.com>
Fri, 29 Jul 2011 19:16:29 +0000 (13:16 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 29 Jul 2011 19:31:53 +0000 (13:31 -0600)
Without this, cygwin failed to compile:

In file included from ../src/rpc/virnetmessage.h:24,
                 from ../src/rpc/virnetclient.h:27,
                 from remote/remote_driver.c:31:
../src/rpc/virnetprotocol.h:9:21: error: rpc/rpc.h: No such file or directory

With that fixed, compilation warned:

rpc/virnetsocket.c: In function 'virNetSocketNewListenUNIX':
rpc/virnetsocket.c:347: warning: format '%d' expects type 'int', but argument 8 has type 'gid_t' [-Wformat]
rpc/virnetsocket.c: In function 'virNetSocketGetLocalIdentity':
rpc/virnetsocket.c:743: warning: pointer targets in passing argument 5 of 'getsockopt' differ in signedness

* src/Makefile.am (libvirt_driver_remote_la_CFLAGS)
(libvirt_net_rpc_client_la_CFLAGS)
(libvirt_net_rpc_server_la_CFLAGS): Include XDR_CFLAGS, for rpc
headers on cygwin.
* src/rpc/virnetsocket.c (virNetSocketNewListenUNIX)
(virNetSocketGetLocalIdentity): Avoid compiler warnings.

src/Makefile.am
src/rpc/virnetsocket.c

index b7e49912eda37795f6156be171754836a7834af6..009ff2548dd55f0714b55d86db8f3af2522bf1a8 100644 (file)
@@ -578,6 +578,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
 endif
 libvirt_driver_remote_la_CFLAGS =                              \
                $(GNUTLS_CFLAGS)                                \
+               $(XDR_CFLAGS)                                   \
                -I@top_srcdir@/src/conf                         \
                -I@top_srcdir@/src/rpc                          \
                $(AM_CFLAGS)
@@ -1293,6 +1294,7 @@ EXTRA_DIST += \
 endif
 libvirt_net_rpc_server_la_CFLAGS = \
                        $(AVAHI_CFLAGS) \
+                       $(XDR_CFLAGS) \
                        $(AM_CFLAGS) \
                        $(POLKIT_CFLAGS)
 libvirt_net_rpc_server_la_LDFLAGS = \
@@ -1309,7 +1311,8 @@ libvirt_net_rpc_client_la_SOURCES = \
        rpc/virnetclientstream.h rpc/virnetclientstream.c \
        rpc/virnetclient.h rpc/virnetclient.c
 libvirt_net_rpc_client_la_CFLAGS = \
-                       $(AM_CFLAGS)
+                       $(AM_CFLAGS) \
+                       $(XDR_CFLAGS)
 libvirt_net_rpc_client_la_LDFLAGS = \
                        $(AM_LDFLAGS) \
                        $(CYGWIN_EXTRA_LDFLAGS) \
index dcdc93757600348b737edf982b5ea25d4e5f7462..41b691a6aad18bee5daf1f63f3597adc4476bf9e 100644 (file)
@@ -345,8 +345,8 @@ int virNetSocketNewListenUNIX(const char *path,
      */
     if (grp != 0 && chown(path, -1, grp)) {
         virReportSystemError(errno,
-                             _("Failed to change group ID of '%s' to %d"),
-                             path, grp);
+                             _("Failed to change group ID of '%s' to %u"),
+                             path, (unsigned int) grp);
         goto error;
     }
 
@@ -737,7 +737,7 @@ int virNetSocketGetLocalIdentity(virNetSocketPtr sock,
                                  pid_t *pid)
 {
     struct ucred cr;
-    unsigned int cr_len = sizeof (cr);
+    socklen_t cr_len = sizeof (cr);
     virMutexLock(&sock->lock);
 
     if (getsockopt(sock->fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) < 0) {