Module Name: src Committed By: martin Date: Tue Aug 1 12:31:45 UTC 2017
Modified Files: src/lib/libpthread: pthread_attr.c Log Message: pthread__attr_init_private: malloc+memset -> calloc. Also initialize all values to the proper defaults. This fixes the "rustc panic" discussed on pkgsrc-users. OK: joerg To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/lib/libpthread/pthread_attr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libpthread/pthread_attr.c diff -u src/lib/libpthread/pthread_attr.c:1.17 src/lib/libpthread/pthread_attr.c:1.18 --- src/lib/libpthread/pthread_attr.c:1.17 Sun Jul 2 16:41:32 2017 +++ src/lib/libpthread/pthread_attr.c Tue Aug 1 12:31:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_attr.c,v 1.17 2017/07/02 16:41:32 joerg Exp $ */ +/* $NetBSD: pthread_attr.c,v 1.18 2017/08/01 12:31:45 martin Exp $ */ /*- * Copyright (c) 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread_attr.c,v 1.17 2017/07/02 16:41:32 joerg Exp $"); +__RCSID("$NetBSD: pthread_attr.c,v 1.18 2017/08/01 12:31:45 martin Exp $"); #include <errno.h> #include <stdio.h> @@ -58,11 +58,12 @@ pthread__attr_init_private(pthread_attr_ if ((p = attr->pta_private) != NULL) return p; - p = malloc(sizeof(*p)); + p = calloc(1, sizeof(*p)); if (p != NULL) { - memset(p, 0, sizeof(*p)); attr->pta_private = p; p->ptap_policy = SCHED_OTHER; + p->ptap_stacksize = pthread__stacksize; + p->ptap_guardsize = pthread__guardsize; } return p; }