From owner-p4-projects@FreeBSD.ORG Sat Nov 20 05:31:16 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 378CE16A4D0; Sat, 20 Nov 2004 05:31:16 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 126D616A4CE for ; Sat, 20 Nov 2004 05:31:16 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03AB043D54 for ; Sat, 20 Nov 2004 05:31:16 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id iAK5VFQx014535 for ; Sat, 20 Nov 2004 05:31:15 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id iAK5VFoU014532 for perforce@freebsd.org; Sat, 20 Nov 2004 05:31:15 GMT (envelope-from davidxu@freebsd.org) Date: Sat, 20 Nov 2004 05:31:15 GMT Message-Id: <200411200531.iAK5VFoU014532@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to davidxu@freebsd.org using -f From: David Xu To: Perforce Change Reviews Subject: PERFORCE change 65536 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2004 05:31:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=65536 Change 65536 by davidxu@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