2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

proc: Make small stat parsing read pgid and sid

They are just two next in this file, so extend. This is
required for pgid/sid early read, see next patches for
details.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-04-11 22:09:12 +04:00
parent 2a0c526b6d
commit 6ed9f87269
2 changed files with 5 additions and 3 deletions

View File

@@ -195,10 +195,10 @@ int parse_pid_stat_small(pid_t pid, struct proc_pid_stat_small *s)
return -1;
memset(s, 0, sizeof(*s));
n = fscanf(f, "%d " PROC_TASK_COMM_LEN_FMT " %c %d",
&s->pid, s->comm, &s->state, &s->ppid);
n = fscanf(f, "%d " PROC_TASK_COMM_LEN_FMT " %c %d %d %d",
&s->pid, s->comm, &s->state, &s->ppid, &s->pgid, &s->sid);
if (n < 4) {
if (n < 6) {
pr_err("Parsing %d's stat failed (#fields do not match)\n", pid);
return -1;
}