diff options
author | Marian Csontos <mcsontos@redhat.com> | 2012-08-02 16:40:21 +0200 |
---|---|---|
committer | Marian Csontos <mcsontos@redhat.com> | 2012-08-02 16:50:37 +0200 |
commit | 3843f54974ea7c3bbe51fcd681a55fc23f4e7736 (patch) | |
tree | d62fee00d6fdaef1d5ca18f9ed2839a9b481381e | |
parent | 55c9286dea6b7d77338b4663d67337ca5a7b2b55 (diff) | |
download | lvm2-3843f54974ea7c3bbe51fcd681a55fc23f4e7736.tar.gz lvm2-3843f54974ea7c3bbe51fcd681a55fc23f4e7736.tar.xz lvm2-3843f54974ea7c3bbe51fcd681a55fc23f4e7736.zip |
[lvmetad] Continue reading/writing on EINTR
-rw-r--r-- | libdaemon/client/daemon-shared.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libdaemon/client/daemon-shared.c b/libdaemon/client/daemon-shared.c index f90deb4b..b7677941 100644 --- a/libdaemon/client/daemon-shared.c +++ b/libdaemon/client/daemon-shared.c @@ -56,9 +56,9 @@ int read_buffer(int fd, char **buffer) { errno = ECONNRESET; goto fail; /* we should never encounter EOF here */ } - if (result < 0 && errno != EAGAIN && errno != EWOULDBLOCK) + if (result < 0 && errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) goto fail; - /* TODO call select here if we encountered EAGAIN/EWOULDBLOCK */ + /* TODO call select here if we encountered EAGAIN/EWOULDBLOCK/EINTR */ } return 1; fail: @@ -71,7 +71,7 @@ fail: * Write a buffer to a filedescriptor. Keep trying. Blocks (even on * SOCK_NONBLOCK) until all of the write went through. * - * TODO use select on EWOULDBLOCK/EAGAIN to avoid useless spinning + * TODO use select on EWOULDBLOCK/EAGAIN/EINTR to avoid useless spinning */ int write_buffer(int fd, const char *buffer, int length) { static const char terminate[] = "\n##\n"; @@ -82,7 +82,7 @@ write: int result = write(fd, buffer + written, length - written); if (result > 0) written += result; - if (result < 0 && errno != EWOULDBLOCK && errno != EAGAIN) + if (result < 0 && errno != EWOULDBLOCK && errno != EAGAIN && errno != EINTR) return 0; /* too bad */ if (written == length) { if (done) |