Module Name: src
Committed By: snj
Date: Sun Oct 1 16:37:57 UTC 2017
Modified Files:
src/lib/libpthread [netbsd-8]: pthread_attr.c
Log Message:
Pull up following revision(s) (requested by martin in ticket #295):
lib/libpthread/pthread_attr.c: revision 1.18
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.16.24.1 -r1.16.24.2 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.16.24.1 src/lib/libpthread/pthread_attr.c:1.16.24.2
--- src/lib/libpthread/pthread_attr.c:1.16.24.1 Thu Aug 31 08:32:39 2017
+++ src/lib/libpthread/pthread_attr.c Sun Oct 1 16:37:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_attr.c,v 1.16.24.1 2017/08/31 08:32:39 bouyer Exp $ */
+/* $NetBSD: pthread_attr.c,v 1.16.24.2 2017/10/01 16:37:57 snj 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.16.24.1 2017/08/31 08:32:39 bouyer Exp $");
+__RCSID("$NetBSD: pthread_attr.c,v 1.16.24.2 2017/10/01 16:37:57 snj 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;
}