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.
Showing
想要评论请 注册 或 登录