public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Peng Haitao <penght@cn.fujitsu.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: [LTP]  [PATCH] sigrelse01.c: cleanup() should be called only once
Date: Fri, 28 Jan 2011 14:49:06 +0800	[thread overview]
Message-ID: <4D4266E2.9070001@cn.fujitsu.com> (raw)

Hi Garrett,

cleanup() call the function tst_rmdir() to remove the temporary
directory, so cleanup() should be called only once.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 testcases/kernel/syscalls/sigrelse/sigrelse01.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/testcases/kernel/syscalls/sigrelse/sigrelse01.c b/testcases/kernel/syscalls/sigrelse/sigrelse01.c
index 0d0e12b..da612df 100644
--- a/testcases/kernel/syscalls/sigrelse/sigrelse01.c
+++ b/testcases/kernel/syscalls/sigrelse/sigrelse01.c
@@ -373,9 +373,6 @@ static void parent()
 		tst_resm(TBROK, "Unexpected exit code %d from child", rv);
 		break;
 	}
-
-	cleanup();
-
 }				/* end of parent */
 
 /****************************************************************************
@@ -797,8 +794,7 @@ void setup()
 
 	/* set up pipe for parent/child communications */
 	if (pipe(pipe_fd) < 0) {
-		tst_resm(TBROK|TERRNO, "pipe() failed");
-		cleanup();
+		tst_brkm(TBROK|TERRNO, cleanup, "pipe() failed");
 	}
 
 	/*
@@ -812,8 +808,7 @@ void setup()
 
 	/* set up pipe for parent/child communications */
 	if (pipe(pipe_fd2) < 0) {
-		tst_resm(TBROK|TERRNO, "pipe() failed");
-		cleanup();
+		tst_brkm(TBROK|TERRNO, cleanup, "pipe() failed");
 	}
 
 	/*
@@ -840,4 +835,4 @@ void cleanup()
 
 	tst_rmdir();
 
-}
\ No newline at end of file
+}
-- 
1.7.0.1

-- 
Best Regards,
Peng Haitao


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2011-01-28  6:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28  6:49 Peng Haitao [this message]
2011-01-28 10:04 ` [LTP] [PATCH] sigrelse01.c: cleanup() should be called only once Garrett Cooper

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=4D4266E2.9070001@cn.fujitsu.com \
    --to=penght@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    --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