Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH trivial] pty: set tty on error
Date: Fri, 18 Sep 2009 13:21:14 -0400	[thread overview]
Message-ID: <4AB3C18A.5090504@librato.com> (raw)
In-Reply-To: <20090918155507.GA1329-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>



Serge E. Hallyn wrote:
> we always return tty expecting it to hold the error code.
> 
> Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
>  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));

The 'E' in the first format string already geenrates "err %d" and
the integer PTR_ERR(file). The explicit "Error %d" is redundant (and
requires another integer).

See (now added) documentation to __ckpt_generate_err() in the code.

Oren.

> +			tty = ERR_PTR(PTR_ERR(file));
>  			goto out;
> +		}
>  
>  		/*
>  		 * Add file to objhash to ensure proper cleanup later

      parent reply	other threads:[~2009-09-18 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 15:55 [PATCH trivial] pty: set tty on error Serge E. Hallyn
     [not found] ` <20090918155507.GA1329-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-09-18 17:00   ` Oren Laadan
2009-09-18 17:21   ` Oren Laadan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AB3C18A.5090504@librato.com \
    --to=orenl-rdfvbdnroixbdgjk7y7tuq@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox