Commit e25d1152 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

files: Use switch in collect_fd

For easier transition to tty c/r. We will need more
types here, thus using switch statement makes code
a bit easier to read.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1fd9913f
...@@ -177,10 +177,15 @@ static int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info) ...@@ -177,10 +177,15 @@ static int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info)
list_add_tail(&new_le->desc_list, &le->desc_list); list_add_tail(&new_le->desc_list, &le->desc_list);
new_le->desc = fdesc; new_le->desc = fdesc;
if (unlikely(new_le->fe->type == FD_TYPES__EVENTPOLL)) switch (new_le->fe->type) {
case FD_TYPES__EVENTPOLL:
list_add_tail(&new_le->ps_list, &rst_info->eventpoll); list_add_tail(&new_le->ps_list, &rst_info->eventpoll);
else break;
default:
list_add_tail(&new_le->ps_list, &rst_info->fds); list_add_tail(&new_le->ps_list, &rst_info->fds);
break;
}
return 0; return 0;
} }
......
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