* [LTP] [PATCH 1/2]sigpause/3-1.c Clean up
@ 2012-08-28 8:59 DAN LI
2012-08-28 9:05 ` [LTP] [PATCH 2/2]sigpause/3-1.c Fix hung DAN LI
2012-08-29 3:14 ` [LTP] [PATCH 1/2]sigpause/3-1.c Clean up Wanlong Gao
0 siblings, 2 replies; 4+ messages in thread
From: DAN LI @ 2012-08-28 8:59 UTC (permalink / raw)
To: LTP list
Clean up sigpause/3-1.c.
Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
---
.../conformance/interfaces/sigpause/3-1.c | 34
++++++++++----------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git
a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
index 2fa7504..00024ed 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
@@ -32,7 +32,8 @@
int result = 2;
int sem = INMAIN;
-void handler() {
+void handler()
+{
printf("signal was called\n");
return;
}
@@ -48,18 +49,20 @@ void *a_thread_func()
return_value = sigpause(SIGTOTEST);
if (return_value == -1) {
if (errno == EINTR) {
- printf ("Test PASSED: sigpause returned -1 and set errno to EINTR\n");
+ printf("Test PASSED: sigpause returned -1 "
+ "and set errno to EINTR\n");
result = 0;
} else {
- printf ("Test FAILED: sigpause did not set errno to EINTR\n");
+ printf("Test FAILED: sigpause did not "
+ "set errno to EINTR\n");
result = 1;
}
} else {
- if (errno == EINTR) {
- printf ("Test FAILED: sigpause did not return -1\n");
- }
- printf ("Test FAILED: sigpause did not set errno to EINTR\n");
- printf ("Test FAILED: sigpause did not return -1\n");
+ if (errno == EINTR)
+ printf("Test FAILED: sigpause did not return -1\n");
+
+ printf("Test FAILED: sigpause did not set errno to EINTR\n");
+ printf("Test FAILED: sigpause did not return -1\n");
result = 1;
}
@@ -71,16 +74,14 @@ int main()
{
pthread_t new_th;
- if (pthread_create(&new_th, NULL, a_thread_func, NULL) != 0)
- {
+ if (pthread_create(&new_th, NULL, a_thread_func, NULL) != 0) {
perror("Error creating thread\n");
return PTS_UNRESOLVED;
}
sleep(1);
- if (pthread_kill(new_th, SIGTOTEST) != 0)
- {
+ if (pthread_kill(new_th, SIGTOTEST) != 0) {
printf("Test UNRESOLVED: Couldn't send signal to thread\n");
return PTS_UNRESOLVED;
}
@@ -89,13 +90,12 @@ int main()
while (sem == INTHREAD)
sleep(1);
- if (result == 2) {
+ if (result == 2)
return PTS_UNRESOLVED;
- }
- if (result == 1) {
+
+ if (result == 1)
return PTS_FAIL;
- }
printf("Test PASSED\n");
return PTS_PASS;
-}
\ No newline at end of file
+}
--
1.7.10.2
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH 2/2]sigpause/3-1.c Fix hung
2012-08-28 8:59 [LTP] [PATCH 1/2]sigpause/3-1.c Clean up DAN LI
@ 2012-08-28 9:05 ` DAN LI
2012-08-29 3:14 ` Wanlong Gao
2012-08-29 3:14 ` [LTP] [PATCH 1/2]sigpause/3-1.c Clean up Wanlong Gao
1 sibling, 1 reply; 4+ messages in thread
From: DAN LI @ 2012-08-28 9:05 UTC (permalink / raw)
To: LTP list
If sem is set as INTHREAD finally,the loop will be endless.
Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
---
.../open_posix_testsuite/conformance/interfaces/sigpause/3-1.c |
3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
index 00024ed..6f1f454 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
@@ -30,7 +30,7 @@
#define INMAIN 1
int result = 2;
-int sem = INMAIN;
+int sem = INTHREAD;
void handler()
{
@@ -86,7 +86,6 @@ int main()
return PTS_UNRESOLVED;
}
- sem = INTHREAD;
while (sem == INTHREAD)
sleep(1);
--
1.7.10.2
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 1/2]sigpause/3-1.c Clean up
2012-08-28 8:59 [LTP] [PATCH 1/2]sigpause/3-1.c Clean up DAN LI
2012-08-28 9:05 ` [LTP] [PATCH 2/2]sigpause/3-1.c Fix hung DAN LI
@ 2012-08-29 3:14 ` Wanlong Gao
1 sibling, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2012-08-29 3:14 UTC (permalink / raw)
To: DAN LI; +Cc: LTP list
On 08/28/2012 04:59 PM, DAN LI wrote:
> Clean up sigpause/3-1.c.
>
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
cleanups are always welcome, pushed, thank you.
Wanlong Gao
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 2/2]sigpause/3-1.c Fix hung
2012-08-28 9:05 ` [LTP] [PATCH 2/2]sigpause/3-1.c Fix hung DAN LI
@ 2012-08-29 3:14 ` Wanlong Gao
0 siblings, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2012-08-29 3:14 UTC (permalink / raw)
To: DAN LI; +Cc: LTP list
On 08/28/2012 05:05 PM, DAN LI wrote:
> If sem is set as INTHREAD finally,the loop will be endless.
>
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
Good catch, pushed, thank you.
Wanlong Gao
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-29 3:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-28 8:59 [LTP] [PATCH 1/2]sigpause/3-1.c Clean up DAN LI
2012-08-28 9:05 ` [LTP] [PATCH 2/2]sigpause/3-1.c Fix hung DAN LI
2012-08-29 3:14 ` Wanlong Gao
2012-08-29 3:14 ` [LTP] [PATCH 1/2]sigpause/3-1.c Clean up Wanlong Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox