public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Garrett Cooper <yanegomi@gmail.com>, Matt Helsley <matthltc@us.ibm.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: [LTP] [PATCH 4/4] mqns04.c: don't exit strangely in clone case (please read)
Date: Wed, 28 Apr 2010 16:10:09 -0500	[thread overview]
Message-ID: <20100428211009.GC20642@us.ibm.com> (raw)
In-Reply-To: <20100428210906.GA20572@us.ibm.com>

The child spawned by mqns04.c terminates by calling tst_exit().
tst_exit() basically calls exit(0).  In the case where the child
was spawned with fork+unshare that's fine, but in the case where
it was spawned by clone() it is not:  it causes the parent to see
the exit status as 4, as in:

posixmq_namespace_04    1  TFAIL  :  Child did not exit normally (status 4)

This patch simply makes the child do _exit(0) on success, and that
works fine.  I wonder if there is some way we can generically do
the right thing at txt_exit()?

Note that other tests have the same problem:
pid_namespace1    0  TWARN  :  child exited with signal 4
pid_namespace4    2  TFAIL  :  Container init pid got killed by signal 4
pidns20     1  TBROK  :  parent: cinit is terminated by 4

Should we just do this same "fix" in those testcases?

Signed-off-by: Serge Hallyn <serue@us.ibm.com>
---
 testcases/kernel/containers/mqns/mqns_04.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/containers/mqns/mqns_04.c b/testcases/kernel/containers/mqns/mqns_04.c
index 98d4e39..6f4bb8f 100644
--- a/testcases/kernel/containers/mqns/mqns_04.c
+++ b/testcases/kernel/containers/mqns/mqns_04.c
@@ -78,6 +78,7 @@ int check_mqueue(void *vtest)
 	write(p2[1], "go", 3);
 	read(p1[0], buf, 3);
 
+	_exit(0);
 	tst_exit();
 }
 
-- 
1.7.0


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2010-04-28 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28 21:09 [LTP] [PATCH 1/4] mqns: strip leading / from mq names Serge E. Hallyn
2010-04-28 21:09 ` [LTP] [PATCH 2/4] pidns30: strip leading / from name passed to mq_open Serge E. Hallyn
2010-04-28 23:02   ` Garrett Cooper
2010-04-28 21:09 ` [LTP] [PATCH 3/4] mqns2: fix some error checking and reporting Serge E. Hallyn
2010-04-28 23:02   ` Garrett Cooper
2010-04-28 21:10 ` Serge E. Hallyn [this message]
2010-04-28 23:04 ` [LTP] [PATCH 1/4] mqns: strip leading / from mq names Garrett Cooper
2010-04-29  0:29   ` Serge E. Hallyn

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=20100428211009.GC20642@us.ibm.com \
    --to=serue@us.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=matthltc@us.ibm.com \
    --cc=yanegomi@gmail.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