From feda34319a5d4461294e156f4d555ca1124f7dbc Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Tue, 13 Jan 2015 22:19:58 +0300 Subject: [PATCH] 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: Pavel Emelyanov --- tty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tty.c b/tty.c index 7a6a30c6c..c4b8765d1 100644 --- a/tty.c +++ b/tty.c @@ -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;