mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-09 23:10:08 +00:00
a178a4e7bf
We currently use safewrite from inside libvirt and don't want to publish any such function name. However, we do want to use it in applications like virsh, libvirtd and libvirt_proxy that link with libvirt. To that end, this change moves that function definition (along with the nearly identical saferead) into a new file, util-lib.c. To avoid maintaining separate copies of even such small functions, we simply include that new file from util.c. Then, the separate applications that need to use safewrite simply compile and link with util-lib.c. Of course, this does mean that each of those applications will containing two copies of these functions. However, the functions are so small that it's not worth worrying about that. * src/util.c (saferead, safewrite): Move function definitions to util-lib.c and include that .c file. * src/util-lib.c (saferead, safewrite): New file. Functions from src/util.c with slight change (s/int r =/ssize_t r =/) to reflect read/write return type. * src/util-lib.h: Declare the two moved functions. * src/util.h: Remove declarations. Include src/util-lib.h. * proxy/Makefile.am (libvirt_proxy_SOURCES): Add src/util-lib.c. * qemud/Makefile.am (libvirtd_SOURCES): Likewise. * src/Makefile.am (virsh_SOURCES): Add util-lib.c. Remove some SP-before-TAB.
25 lines
924 B
Makefile
25 lines
924 B
Makefile
## Process this file with automake to produce Makefile.in
|
|
|
|
if WITH_PROXY
|
|
INCLUDES = -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
|
|
-I$(top_builddir)/include -I@top_srcdir@/include \
|
|
-I@top_srcdir@/proxy -I@top_srcdir@/src @LIBXML_CFLAGS@ \
|
|
-DPROXY -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
|
|
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" $(WARN_CFLAGS) $(LIBVIRT_FEATURES)
|
|
|
|
libexec_PROGRAMS = libvirt_proxy
|
|
|
|
libvirt_proxy_SOURCES = libvirt_proxy.c @top_srcdir@/src/xend_internal.c \
|
|
@top_srcdir@/src/xen_internal.c @top_srcdir@/src/virterror.c \
|
|
@top_srcdir@/src/sexpr.c @top_srcdir@/src/xml.c \
|
|
@top_srcdir@/src/xs_internal.c @top_srcdir@/src/buf.c \
|
|
@top_srcdir@/src/util-lib.c \
|
|
@top_srcdir@/src/uuid.c
|
|
libvirt_proxy_LDFLAGS = $(WARN_CFLAGS)
|
|
libvirt_proxy_DEPENDENCIES =
|
|
libvirt_proxy_LDADD =
|
|
|
|
install-exec-hook:
|
|
chmod u+s $(DESTDIR)$(libexecdir)/libvirt_proxy
|
|
endif
|