Commit 0910b72b authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Use is_service_fd where appropriate

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 45cc85ee
...@@ -385,7 +385,7 @@ static int post_open_fd(int pid, FdinfoEntry *fe, struct file_desc *d) ...@@ -385,7 +385,7 @@ static int post_open_fd(int pid, FdinfoEntry *fe, struct file_desc *d)
if (!d->ops->post_open) if (!d->ops->post_open)
return 0; return 0;
if (fe->fd == get_service_fd(CTL_TTY_OFF)) if (is_service_fd(fe->fd, CTL_TTY_OFF))
return d->ops->post_open(d, fe->fd); return d->ops->post_open(d, fe->fd);
fle = file_master(d); fle = file_master(d);
......
...@@ -345,7 +345,7 @@ static int tty_restore_ctl_terminal(struct file_desc *d, int fd) ...@@ -345,7 +345,7 @@ static int tty_restore_ctl_terminal(struct file_desc *d, int fd)
int slave, ret = -1; int slave, ret = -1;
char pts_name[64]; char pts_name[64];
if (fd != get_service_fd(CTL_TTY_OFF)) if (!is_service_fd(fd, CTL_TTY_OFF))
return 0; return 0;
snprintf(pts_name, sizeof(pts_name), PTS_FMT, info->tie->pty->index); snprintf(pts_name, sizeof(pts_name), PTS_FMT, info->tie->pty->index);
......
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