Skip to content

Commit ab73a84

Browse files
Taemin Haavagin
authored andcommitted
criu/proc_parse: refactor the eventpoll parser
Eventpollentry's fields are set only when ret == 3 or ret == 6. The remaining cases can be grouped together to an error Signed-off-by: Taemin Ha <[email protected]> Signed-off-by: Andrei Vagin <[email protected]>
1 parent c03c737 commit ab73a84

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

criu/proc_parse.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,18 +1972,15 @@ static int parse_fdinfo_pid_s(int pid, int fd, int type, void *arg)
19721972
" pos:%lli ino:%lx sdev:%x",
19731973
&e->tfd, &e->events, (long long *)&e->data, (long long *)&e->pos,
19741974
(long *)&e->inode, &e->dev);
1975-
if (ret < 3 || ret > 6) {
1976-
eventpoll_tfd_entry__free_unpacked(e, NULL);
1977-
goto parse_err;
1978-
} else if (ret == 3) {
1975+
if (ret == 3) {
19791976
e->has_dev = false;
19801977
e->has_inode = false;
19811978
e->has_pos = false;
19821979
} else if (ret == 6) {
19831980
e->has_dev = true;
19841981
e->has_inode = true;
19851982
e->has_pos = true;
1986-
} else if (ret < 6) {
1983+
} else {
19871984
eventpoll_tfd_entry__free_unpacked(e, NULL);
19881985
goto parse_err;
19891986
}

0 commit comments

Comments
 (0)