Index: src/Makefile.am =================================================================== RCS file: /data/cvs/libxen/src/Makefile.am,v retrieving revision 1.69 diff -p -r1.69 Makefile.am *** src/Makefile.am 22 Feb 2008 15:53:13 -0000 1.69 --- src/Makefile.am 25 Feb 2008 08:34:36 -0000 *************** libvirt_la_LDFLAGS = -Wl,--version-scrip *** 96,102 **** -version-info @LIBVIRT_VERSION_INFO@ \ $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \ @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@ ! libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) bin_PROGRAMS = virsh --- 96,102 ---- -version-info @LIBVIRT_VERSION_INFO@ \ $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \ @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@ ! libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT bin_PROGRAMS = virsh Index: src/util-lib.h =================================================================== RCS file: /data/cvs/libxen/src/util-lib.h,v retrieving revision 1.1 diff -p -r1.1 util-lib.h *** src/util-lib.h 22 Feb 2008 15:53:13 -0000 1.1 --- src/util-lib.h 25 Feb 2008 08:34:36 -0000 *************** *** 10,15 **** --- 10,24 ---- #include + /* + * To avoid a double definition of the function when compiling + * programs using both util-lib and libvirt, like virsh + */ + #ifdef IN_LIBVIRT + #define saferead libvirt_saferead + #define safewrite libvirt_safewrite + #endif + int saferead(int fd, void *buf, size_t count); ssize_t safewrite(int fd, const void *buf, size_t count);