* [LTP] [PATCH] sigrelse01.c: cleanup() should be called only once
@ 2011-01-28 6:49 Peng Haitao
2011-01-28 10:04 ` Garrett Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Peng Haitao @ 2011-01-28 6:49 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [LTP] [PATCH] sigrelse01.c: cleanup() should be called only once
2011-01-28 6:49 [LTP] [PATCH] sigrelse01.c: cleanup() should be called only once Peng Haitao
@ 2011-01-28 10:04 ` Garrett Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Garrett Cooper @ 2011-01-28 10:04 UTC (permalink / raw)
To: Peng Haitao; +Cc: ltp-list
On Thu, Jan 27, 2011 at 10:49 PM, Peng Haitao <penght@cn.fujitsu.com> wrote:
> Hi Garrett,
>
> cleanup() call the function tst_rmdir() to remove the temporary
> directory, so cleanup() should be called only once.
I did some style cleanup, but I'm concerned that the signal
handler code setup might not function as expected because it used to
build off of choose_sig. Please verify whether or not things work for
you now.
Thanks,
-Garrett
------------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-28 10:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 6:49 [LTP] [PATCH] sigrelse01.c: cleanup() should be called only once Peng Haitao
2011-01-28 10:04 ` Garrett Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox