All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [POSIX][PATCH]pthread_attr_t object should be initialized before using it
@ 2011-01-24  9:28 Bian Naimeng
  2011-02-14 15:07 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Bian Naimeng @ 2011-01-24  9:28 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

pthread_attr_t object should be initialized before using it.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 .../interfaces/pthread_attr_setstacksize/2-1.c     |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c
index 92fb33a..bf2ebc2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c
@@ -41,14 +41,14 @@ void *thread_func()
 	size_t ssize;
 	int rc;
 
-	if ((rc = pthread_getattr_np(pthread_self(), &attr)) != 0) {
-		printf(ERROR_PREFIX "pthread_getattr_np: %s\n", strerror(rc));
-		exit(PTS_FAIL);
-	}
 	if ((rc = pthread_attr_init(&attr)) != 0) {
 		printf(ERROR_PREFIX "pthread_attr_init: %s\n", strerror(rc));
 		exit(PTS_FAIL);
 	}
+	if ((rc = pthread_getattr_np(pthread_self(), &attr)) != 0) {
+		printf(ERROR_PREFIX "pthread_getattr_np: %s\n", strerror(rc));
+		exit(PTS_FAIL);
+	}
 	if ((rc = pthread_attr_getstacksize(&attr, &ssize)) != 0) {
 		printf(ERROR_PREFIX "pthread_attr_getstacksize: %s\n",
 			strerror(rc));
@@ -127,4 +127,4 @@ int main()
 
 	printf("Test PASSED\n");
 	return PTS_PASS;
-}
\ No newline at end of file
+}
-- 
1.7.0.4



-- 
Regards
Bian Naimeng


------------------------------------------------------------------------------
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

end of thread, other threads:[~2011-02-14 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24  9:28 [LTP] [POSIX][PATCH]pthread_attr_t object should be initialized before using it Bian Naimeng
2011-02-14 15:07 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.