All of lore.kernel.org
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Mats Liljegren <mats.liljegren@enea.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/2] SAFE_POPEN: Added function to safe_stdio.h
Date: Mon, 12 May 2014 17:03:29 +0200	[thread overview]
Message-ID: <20140512150329.GG4741@rei> (raw)
In-Reply-To: <1399906092-28901-2-git-send-email-mats.liljegren@enea.com>

Hi!
> +FILE *safe_popen(const char *file, const int lineno, void (cleanup_fn)(void),
> +		 const char *command, const char *type)
> +{
> +	FILE *stream;
> +	const int saved_errno = errno;
> +
> +	errno = 0;
> +	stream = popen(command, type);
> +
> +	if (stream == NULL) {
> +		if (errno != 0) {
> +			tst_brkm(TBROK | TERRNO, cleanup_fn,
> +				 "%s:%d: popen(%s,%s) failed",
> +				 file, lineno, command, type);
> +		} else {
> +			tst_brkm(TBROK, cleanup_fn,
> +				 "%s:%d: popen(%s,%s) failed: Out of memory",
> +				 file, lineno, command, type);
> +		}
> +	}
> +
> +	errno = saved_errno;

I've added missing return stream; here and pushed both patches, thanks.

> +}

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2014-05-12 15:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 14:48 [LTP] [PATCH 0/2] safe_stdio: Added SAFE_POPEN() + new error message format Mats Liljegren
2014-05-12 14:48 ` [LTP] [PATCH 1/2] SAFE_POPEN: Added function to safe_stdio.h Mats Liljegren
2014-05-12 15:03   ` chrubis [this message]
     [not found]     ` <20140512171433.0ce9f681@mats-desktop>
2014-05-12 15:34       ` chrubis
     [not found]         ` <20140512175927.62b098ce@mats-desktop>
2014-05-13 12:02           ` chrubis
2014-05-12 14:48 ` [LTP] [PATCH 2/2] safe_stdio: Error messages in new format Mats Liljegren

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=20140512150329.GG4741@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=mats.liljegren@enea.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.