ntfsclone: fix restore from stdin
When doing a ntfclone-restore from stdin and stdin is then closed, ntfsclone will loop forever: $ cat corrupt_image.gz | gzip -d | ntfsclone -r -O somedisk - With this patch the io_all() loop will return an error when the input-stream is closed.edge.strict_endians
parent
d6c0cc5786
commit
48f652e0e1
|
@ -529,6 +529,8 @@ static int io_all(void *fd, void *buf, int count, int do_write)
|
|||
if (i < 0) {
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
return -1;
|
||||
} else if (i == 0 && !do_write && opt.restore_image) {
|
||||
return -1;
|
||||
} else {
|
||||
count -= i;
|
||||
buf = i + (char *) buf;
|
||||
|
|
Loading…
Reference in New Issue