public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/2] pan/ltp-pan.c: fix compilation warnings
Date: Mon, 23 Jun 2014 15:48:53 +0200	[thread overview]
Message-ID: <20140623134852.GC6050@rei.Home> (raw)
In-Reply-To: <1403513949-24653-1-git-send-email-wangxg.fnst@cn.fujitsu.com>

Hi!
>  	static long cmdno = 0;
>  	int errpipe[2];		/* way to communicate to parent that the tag  */
>  	char errbuf[1024];	/* didn't actually start */
> +	int ret;
>  
>  	/* Try to open the file that will be stdout for the test */
>  	if (test_out_dir) {
> @@ -1026,7 +1025,8 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode,
>  		char *termtype;
>  		struct tms notime = { 0, 0, 0, 0 };
>  
> -		read(errpipe[0], errbuf, errlen);
> +		ret = read(errpipe[0], errbuf, errlen);
> +		(void)ret;

I don't like that we do this just to silence compiler warning.

Can't we issue an error message in case that the read() failed instead?

i.e.

	if (read(errpipe[0], errbuf, errlen))
		fprintf(stderr, "Failed to read errbuf\n");

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      parent reply	other threads:[~2014-06-23 13:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23  8:59 [LTP] [PATCH 1/2] pan/ltp-pan.c: fix compilation warnings Xiaoguang Wang
2014-06-23  8:59 ` [LTP] [PATCH 2/2] pan/ltp-pan.c: add statistics about not fully tested testcases Xiaoguang Wang
2014-06-23 14:50   ` chrubis
2014-06-23 13:48 ` chrubis [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=20140623134852.GC6050@rei.Home \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangxg.fnst@cn.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox