Commit feda3431 authored by Pavel Emelyanov's avatar Pavel Emelyanov

tty: Assign empty file_desc_ops to fake file descs

The newer cleanups in fd inherit code need every file-desc
to have non-NULL ops. This hunk was lost in tty code in the
very beginning.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent af91bfa2
......@@ -280,6 +280,7 @@ static struct file_desc *pty_alloc_reg(struct tty_info *info, bool add)
TtyFileEntry *tfe = info->tfe;
const size_t namelen = 64;
struct reg_file_info *r;
static struct file_desc_ops noops = {};
r = xzalloc(sizeof(*r) + sizeof(*r->rfe) + namelen);
if (!r)
......@@ -296,9 +297,9 @@ static struct file_desc *pty_alloc_reg(struct tty_info *info, bool add)
info->tie->pty->index);
if (add)
file_desc_add(&r->d, tfe->id, NULL);
file_desc_add(&r->d, tfe->id, &noops);
else
file_desc_init(&r->d, tfe->id, NULL);
file_desc_init(&r->d, tfe->id, &noops);
r->rfe->id = tfe->id;
r->rfe->flags = tfe->flags;
......
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