On Thu, Nov 18, 2010 at 9:49 AM, Cyril Hrubis <[email protected]> wrote:
> Hi!
>> Destroy mutex an mutex_attr object at end of test.
>>
>> Signed-off-by: Bian Naimeng <[email protected]>
>>
>> ---
>> .../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.
>> 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");
...
Overall this shouldn't really matter anyhow because the OS should be
cleaning up mutexes when done (just like file descriptors when
fcntl(.., FD_CLOEXEC, ..) isn't called and the process has cleaned up
all of the file descriptors, etc), but I agree that it would make
things more consistent and is more correct.
Patch committed.
Thanks,
-Garrett
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list