Commit 46083e9e authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

restore: Don't forget to skip data on attached pipes

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 0cd579ab
...@@ -952,7 +952,7 @@ static int create_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi, int ...@@ -952,7 +952,7 @@ static int create_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi, int
return 0; return 0;
} }
static int attach_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi) static int attach_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi, int pipes_fd)
{ {
char path[128]; char path[128];
int tmp, fd; int tmp, fd;
...@@ -989,6 +989,8 @@ static int attach_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi) ...@@ -989,6 +989,8 @@ static int attach_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi)
return 1; return 1;
pi->users--; pi->users--;
lseek(pipes_fd, e->bytes, SEEK_CUR);
return 0; return 0;
} }
...@@ -1025,7 +1027,7 @@ static int open_pipe(int pid, struct pipe_entry *e, int *pipes_fd) ...@@ -1025,7 +1027,7 @@ static int open_pipe(int pid, struct pipe_entry *e, int *pipes_fd)
if (pi->pid == pid && !(pi->status & PIPE_CREATED)) if (pi->pid == pid && !(pi->status & PIPE_CREATED))
return create_pipe(pid, e, pi, *pipes_fd); return create_pipe(pid, e, pi, *pipes_fd);
else else
return attach_pipe(pid, e, pi); return attach_pipe(pid, e, pi, *pipes_fd);
} }
static int prepare_pipes(int pid) static int prepare_pipes(int pid)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment