From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [PATCH trivial] pty: set tty on error Date: Fri, 18 Sep 2009 13:00:21 -0400 Message-ID: <4AB3BCA5.20805@librato.com> References: <20090918155507.GA1329@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090918155507.GA1329-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Serge E. Hallyn" Cc: Linux Containers List-Id: containers.vger.kernel.org got it, thanks. Serge E. Hallyn wrote: > we always return tty expecting it to hold the error code. > > Signed-off-by: Serge E. Hallyn > --- > drivers/char/tty_io.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c > index 1729b2f..ee95938 100644 > --- a/drivers/char/tty_io.c > +++ b/drivers/char/tty_io.c > @@ -3033,8 +3033,12 @@ static struct tty_struct *do_restore_tty(struct ckpt_ctx *ctx) > */ > if (master) { > file = pty_open_by_index("/dev/ptmx", h->index); > - if (IS_ERR(file)) > + if (IS_ERR(file)) { > + ckpt_write_err(ctx, "TE", "Error %d opening /dev/ptmx", > + PTR_ERR(file)); > + tty = ERR_PTR(PTR_ERR(file)); > goto out; > + } > > /* > * Add file to objhash to ensure proper cleanup later