diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-05-28 09:37:42 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-05-28 09:37:42 +0100 |
commit | 861aef6e1558bebad8fc60c1c723f0706fd3ed87 (patch) | |
tree | 7d59668d4da97439597470f4ad52f8e630ee932e /tools/libxc/xc_private.c | |
parent | b140baacc3f44286593c232c1df61f6b1b3ad52f (diff) | |
download | xen-861aef6e1558bebad8fc60c1c723f0706fd3ed87.tar.gz xen-861aef6e1558bebad8fc60c1c723f0706fd3ed87.tar.bz2 xen-861aef6e1558bebad8fc60c1c723f0706fd3ed87.zip |
libxc: save/restore error handling fixes
* Make "read_exact" in libxc always set errno.
* Rename "read_exact" macro in xc_domain_restore.c (which shadows
real function) to RDEXACT and change all callers.
* Make RDEXACT anamorphically use xch for error reporting rather than
* stderr.
* Call PERROR rather than ERROR when appropriate, so that log messages
include errno.
* Save errno in noncached_write so that its errno value is always
* right.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_private.c')
-rw-r--r-- | tools/libxc/xc_private.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 9bcf1754e5..9761b98af4 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -741,6 +741,8 @@ int read_exact(int fd, void *data, size_t size) len = read(fd, (char *)data + offset, size - offset); if ( (len == -1) && (errno == EINTR) ) continue; + if ( len == 0 ) + errno = 0; if ( len <= 0 ) return -1; offset += len; |