]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix errno return in safezero()
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 14 Jun 2011 08:07:39 +0000 (09:07 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 17 Jun 2011 10:02:18 +0000 (11:02 +0100)
commita81822063dd7a1b3dde2992b4ef54bd5a0612067
treeca4fc29259995d8673dc76a63fab4139acc39f9a
parentc24c07f40be4346e08885ce0597604368d5dc7f3
Fix errno return in safezero()

Most of the safezero() implementations return -1 on error,
setting errno. The safezero() impl using posix_fallocate()
though returned a positive errno value on error (due to
the unusual API contract of posix_fallocate() compared to
most syscall APIs).

* src/util/util.c: Ensure safezero() returns -1 and sets
  errno on error.
* src/storage/storage_backend.c: Change safezero != 0 to
  < 0 for detecting errors
src/storage/storage_backend.c
src/util/util.c