mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
files: Don't restore pos when file doesn't support one
It's not quite clean, but on dump non-seekable files dump 0xff...ff into 64-bit pos field of the image. Thus on restore we'd face an error in the do_open_reg. In order not to have separate helper for non-seekable files just skip the position restore for such. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
4869da1781
commit
821621cdb7
@ -529,7 +529,8 @@ static int do_open_reg(struct reg_file_info *rfi, void *arg)
|
|||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lseek(fd, rfi->rfe->pos, SEEK_SET) < 0) {
|
if ((rfi->rfe->pos != -1ULL) &&
|
||||||
|
lseek(fd, rfi->rfe->pos, SEEK_SET) < 0) {
|
||||||
pr_perror("Can't restore file pos");
|
pr_perror("Can't restore file pos");
|
||||||
close(fd);
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user