* [LTP] [POSIX][PATCH]Destroy mutex an mutex_attr object at end of test
@ 2010-11-18 6:54 Bian Naimeng
2010-11-18 17:49 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Bian Naimeng @ 2010-11-18 6:54 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list
Destroy mutex an mutex_attr object at end of test.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
---
.../interfaces/pthread_mutex_getprioceiling/3-1.c | 2 ++
.../interfaces/pthread_mutex_getprioceiling/3-2.c | 3 +++
.../interfaces/pthread_mutex_getprioceiling/3-3.c | 3 +++
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
index d96ae43..5267b63 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
@@ -62,6 +62,8 @@ main(void)
} else
printf("pthread_mutex_getprioceiling passed unexpectedly\n");
+ (void) pthread_mutex_destroy(&mutex);
+
return (error == EINVAL ? PTS_PASS : PTS_FAIL);
#else
printf("pthread_mutex_getprioceiling not supported");
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c
index 843c048..afa12c1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c
@@ -75,6 +75,9 @@ main(void)
} else
printf("pthread_mutex_getprioceiling passed unexpectedly\n");
+ (void) pthread_mutexattr_destroy(&mutex_attr);
+ (void) pthread_mutex_destroy(&mutex);
+
return (error == EINVAL ? PTS_PASS : PTS_FAIL);
#else
printf("pthread_mutex_getprioceiling not supported");
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c
index cf46f77..4aa6b1c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c
@@ -76,6 +76,9 @@ main(void)
} else
printf("pthread_mutex_getprioceiling passed unexpectedly\n");
+ (void) pthread_mutexattr_destroy(&mutex_attr);
+ (void) pthread_mutex_destroy(&mutex);
+
return (error == EINVAL ? PTS_PASS : PTS_UNRESOLVED);
#else
printf("pthread_mutex_getprioceiling not supported");
--
1.7.0.4
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [POSIX][PATCH]Destroy mutex an mutex_attr object at end of test
2010-11-18 6:54 [LTP] [POSIX][PATCH]Destroy mutex an mutex_attr object at end of test Bian Naimeng
@ 2010-11-18 17:49 ` Cyril Hrubis
[not found] ` <AANLkTi=eDrR3hZwjbuHSVxTuswYAPdBQgOvRAoVNxUVB@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2010-11-18 17:49 UTC (permalink / raw)
To: Bian Naimeng; +Cc: ltp-list
Hi!
> Destroy mutex an mutex_attr object at end of test.
>
> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>
> ---
> .../interfaces/pthread_mutex_getprioceiling/3-1.c | 2 ++
> .../interfaces/pthread_mutex_getprioceiling/3-2.c | 3 +++
> .../interfaces/pthread_mutex_getprioceiling/3-3.c | 3 +++
> 3 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
> index d96ae43..5267b63 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
> @@ -62,6 +62,8 @@ main(void)
> } else
> printf("pthread_mutex_getprioceiling passed unexpectedly\n");
>
> + (void) pthread_mutex_destroy(&mutex);
> +
Please never use useless cast like this.
> return (error == EINVAL ? PTS_PASS : PTS_FAIL);
> #else
> printf("pthread_mutex_getprioceiling not supported");
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c
> index 843c048..afa12c1 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c
> @@ -75,6 +75,9 @@ main(void)
> } else
> printf("pthread_mutex_getprioceiling passed unexpectedly\n");
>
> + (void) pthread_mutexattr_destroy(&mutex_attr);
> + (void) pthread_mutex_destroy(&mutex);
> +
And here.
> return (error == EINVAL ? PTS_PASS : PTS_FAIL);
> #else
> printf("pthread_mutex_getprioceiling not supported");
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c
> index cf46f77..4aa6b1c 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c
> @@ -76,6 +76,9 @@ main(void)
> } else
> printf("pthread_mutex_getprioceiling passed unexpectedly\n");
>
> + (void) pthread_mutexattr_destroy(&mutex_attr);
> + (void) pthread_mutex_destroy(&mutex);
> +
And here.
> return (error == EINVAL ? PTS_PASS : PTS_UNRESOLVED);
> #else
> printf("pthread_mutex_getprioceiling not supported");
> --
> 1.7.0.4
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [POSIX][PATCH]Destroy mutex an mutex_attr object at end of test
[not found] ` <AANLkTi=eDrR3hZwjbuHSVxTuswYAPdBQgOvRAoVNxUVB@mail.gmail.com>
@ 2010-11-22 14:08 ` Cyril Hrubis
0 siblings, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2010-11-22 14:08 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list
Hi!
> >> Destroy mutex an mutex_attr object at end of test.
> >>
> >> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
> >>
> >> ---
> >> .../interfaces/pthread_mutex_getprioceiling/3-1.c | 2 ++
> >> .../interfaces/pthread_mutex_getprioceiling/3-2.c | 3 +++
> >> .../interfaces/pthread_mutex_getprioceiling/3-3.c | 3 +++
> >> 3 files changed, 8 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
> >> index d96ae43..5267b63 100644
> >> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
> >> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c
> >> @@ -62,6 +62,8 @@ main(void)
> >> } else
> >> printf("pthread_mutex_getprioceiling passed unexpectedly\n");
> >>
> >> + (void) pthread_mutex_destroy(&mutex);
> >> +
> >
> > Please never use useless cast like this.
>
> Bian was following my example. I've gotten into the habit of doing
> this on calls like this because later versions of glibc start whining
> about blind calls to libcalls / syscalls (take open, write, etc for
> instance) where the developer doesn't check the return code. I did
> this to shut up that whining (because the return code isn't important
> for the overall intent of this testcase), and because I wanted to be
> explicit about the fact that the return code is ignored for human
> readers.
>
Okay.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-22 13:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 6:54 [LTP] [POSIX][PATCH]Destroy mutex an mutex_attr object at end of test Bian Naimeng
2010-11-18 17:49 ` Cyril Hrubis
[not found] ` <AANLkTi=eDrR3hZwjbuHSVxTuswYAPdBQgOvRAoVNxUVB@mail.gmail.com>
2010-11-22 14:08 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox