All of lore.kernel.org
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 2/2] waitid02: split code into separate testcases
Date: Mon, 20 May 2013 16:48:27 +0200	[thread overview]
Message-ID: <20130520144827.GB21016@rei.suse.cz> (raw)
In-Reply-To: <f86dfe8123738c73c9dc2fd08309bfbe09e925e6.1368780870.git.jstancek@redhat.com>

Hi!
> +static void waiting_child(struct testcase_t *t)
> +{
> +	int dummy;
> +	read(t->pipefd[0], &dummy, 1);
> +}
> +
> +static void stopped_child(struct testcase_t *t)
> +{
> +	int dummy;
> +	kill(getpid(), SIGSTOP);
> +	read(t->pipefd[0], &dummy, 1);
> +}
> +
> +static void setup2(struct testcase_t *t)
> +{
> +	if (pipe(t->pipefd) == -1)
> +		tst_brkm(TBROK|TERRNO, cleanup, "pipe");
> +	makechild(t, waiting_child);

I wonder if it would be better to use the TST_CHECKPOINT() interface
that I have written to address synchronization issues.

Have you used pipes because you wanted to avoid tst_tmpdir() and the
FIFO that the code uses? Unfortunately the checkpoint interface must use
fifo instead of pipes to be usable for cases where the file descriptors
cannot be propagated to child because it does exec() right after
fork()... If that is the issue, I can rewrite the checkpoint interface
in a way that would allow either pipe or fifo depending on
initialization parameters.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2013-05-20 14:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  8:59 [LTP] [PATCH 1/2] waitid02: cleanup Jan Stancek
2013-05-17  8:59 ` [LTP] [PATCH 2/2] waitid02: split code into separate testcases Jan Stancek
2013-05-17  9:39   ` Wanlong Gao
2013-05-20 14:48   ` chrubis [this message]
     [not found]     ` <1279126164.4640384.1369062925009.JavaMail.root@redhat.com>
2013-05-20 15:21       ` chrubis
2013-05-20 15:42         ` chrubis
2013-05-21  7:14   ` [LTP] [PATCH v2 " Jan Stancek
2013-05-22 15:02     ` chrubis
2013-05-23  8:24     ` [LTP] [PATCH v3 " Jan Stancek
2013-05-27 16:20       ` chrubis
2013-05-27 17:02       ` [LTP] [PATCH v4 " Jan Stancek
2013-05-27 17:17         ` chrubis
2013-05-17  9:39 ` [LTP] [PATCH 1/2] waitid02: cleanup Wanlong Gao

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=20130520144827.GB21016@rei.suse.cz \
    --to=chrubis@suse.cz \
    --cc=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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.