public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] runner: Chomp away trailing spaces from cmdline
Date: Tue, 24 Sep 2019 12:39:48 +0300	[thread overview]
Message-ID: <20190924093948.GD4019@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20190924091943.27967-1-chris@chris-wilson.co.uk>

On Tue, Sep 24, 2019 at 10:19:43AM +0100, Chris Wilson wrote:
> A minor refinement to remove the trailing spaces after converting the
> NUL-terminators to spaces.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Petri Latvala <petri.latvala@intel.com>

Reviewed-by: Petri Latvala <petri.latvala@intel.com>

I suppose it's impossible that cmdline is entirely spaces...


> ---
>  runner/executor.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index 3e0121421..130ba38d2 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -630,6 +630,10 @@ static const char *get_cmdline(pid_t pid, char *buf, ssize_t len)
>  		if (buf[i] == '\0')
>  			buf[i] = ' ';
>  
> +	/* chomp away the trailing spaces */
> +	while (buf[len - 1] == ' ')
> +		--len;
> +
>  	buf[len] = '\0'; /* but make sure that we return a valid string! */
>  	return buf;
>  }
> -- 
> 2.23.0
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-09-24  9:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24  9:19 [igt-dev] [PATCH i-g-t] runner: Chomp away trailing spaces from cmdline Chris Wilson
2019-09-24  9:39 ` Petri Latvala [this message]
2019-09-24  9:43   ` Chris Wilson
2019-09-24 10:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-09-24 20:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20190924093948.GD4019@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.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