mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
o forgot to retry on EINTR or EAGAIN, doh !
This commit is contained in:
parent
63408276f9
commit
7e38924de5
@ -48,7 +48,9 @@ int _read(int fd, void *buf, size_t count)
|
||||
int tot = 0;
|
||||
|
||||
while (tot < count) {
|
||||
n = read(fd, buf, count - tot);
|
||||
do
|
||||
n = read(fd, buf, count - tot);
|
||||
while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN)));
|
||||
|
||||
if (n <= 0)
|
||||
return tot ? tot : n;
|
||||
@ -87,7 +89,9 @@ int _write(int fd, const void *buf, size_t count)
|
||||
int tot = 0;
|
||||
|
||||
while (tot < count) {
|
||||
n = write(fd, buf, count - tot);
|
||||
do
|
||||
n = write(fd, buf, count - tot);
|
||||
while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN)));
|
||||
|
||||
if (n <= 0)
|
||||
return tot ? tot : n;
|
||||
|
Loading…
Reference in New Issue
Block a user