]> xenbits.xensource.com Git - libvirt.git/commit
src: Make virStr*cpy*() functions return an int
authorAndrea Bolognani <abologna@redhat.com>
Fri, 20 Jul 2018 07:50:37 +0000 (09:50 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 23 Jul 2018 12:27:30 +0000 (14:27 +0200)
commit6c0d0210cbcd5d647f0d882c07f077d444bc707d
treec3cb604bc7b6f3845c4449d0b185b0d0c692f055
parent583bdfa65ca9758d4a4cfce63fc37f36de0bdbee
src: Make virStr*cpy*() functions return an int

Currently, the functions return a pointer to the
destination buffer on success or NULL on failure.

Not only does this kind of error handling look quite
alien in the context of libvirt, where most functions
return zero on success and a negative int on failure,
but it's also somewhat pointless because unless there's
been a failure the returned pointer will be the same
one passed in by the user, thus offering no additional
value.

Change the functions so that they return an int
instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
41 files changed:
docs/hacking.html.in
src/conf/capabilities.c
src/conf/netdev_vport_profile_conf.c
src/conf/nwfilter_conf.c
src/esx/esx_driver.c
src/esx/esx_vi.c
src/esx/esx_vi_types.c
src/hyperv/hyperv_driver.c
src/libxl/libxl_conf.c
src/locking/lock_driver_sanlock.c
src/lxc/lxc_driver.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_ebiptables_driver.c
src/nwfilter/nwfilter_learnipaddr.c
src/openvz/openvz_conf.c
src/qemu/qemu_agent.c
src/qemu/qemu_command.c
src/qemu/qemu_monitor.c
src/remote/remote_driver.c
src/rpc/virnetlibsshsession.c
src/rpc/virnetsocket.c
src/security/security_apparmor.c
src/security/virt-aa-helper.c
src/test/test_driver.c
src/uml/uml_driver.c
src/util/virfdstream.c
src/util/virhostcpu.c
src/util/virhostmem.c
src/util/virlog.c
src/util/virnetdev.c
src/util/virnetdevbridge.c
src/util/virnetdevtap.c
src/util/virnetdevvportprofile.c
src/util/virstring.c
src/util/virstring.h
src/util/virtypedparam.c
src/xenapi/xenapi_driver.c
src/xenconfig/xen_common.c
src/xenconfig/xen_sxpr.c
src/xenconfig/xen_xl.c
src/xenconfig/xen_xm.c