PERFORCE change 65536 for review

David Xu davidxu at FreeBSD.org
Fri Nov 19 21:31:16 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=65536

Change 65536 by davidxu at davidxu_alona on 2004/11/20 05:30:15

	Check NULL thread pointer.

Affected files ...

.. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_seterrno.c#2 edit

Differences ...

==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_seterrno.c#2 (text+ko) ====

@@ -38,16 +38,14 @@
  * This function needs to reference the global error variable which is
  * normally hidden from the user. 
  */
-#ifdef errno
-#undef errno;
-#endif
+#undef errno
 extern int      errno;
 
 void
 _thread_seterrno(pthread_t thread, int error)
 {
 	/* Check for the initial thread: */
-	if (thread == _thr_initial)
+	if (thread == NULL || thread == _thr_initial)
 		/* The initial thread always uses the global error variable: */
 		errno = error;
 	else


More information about the p4-projects mailing list