]> git.ipfire.org Git - thirdparty/libvirt.git/commit
dnsmasq: Fix errno handling and don't unlink non-existing files
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 28 Jun 2011 23:50:06 +0000 (01:50 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 29 Jun 2011 09:38:36 +0000 (11:38 +0200)
commit8cce5436ddec80dcf2c2f803deaa71121179d60a
tree3327668c00f35bcb5bac7296849fbf1984808c01
parent9fdeaeef89aafc318a1d65977226b99fd48a8566
dnsmasq: Fix errno handling and don't unlink non-existing files

addnhostsSave and hostsfileSave expect < 0 return value on error from
addnhostsWrite and hostsfileWrite but then pass err instead of -err
to virReportSystemError that expects an errno value.

Also addnhostsWrite returns -ENOMEM and errno, change this to -errno.

addnhostsWrite and hostsfileWrite tried to unlink the tempfile after
renaming it, making both fail on the final step. Remove the unnecessary
unlink calls.
src/util/dnsmasq.c