Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/lib/libpthread Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/2e8086a76919
branches:  netbsd-8
changeset: 851049:2e8086a76919
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Oct 01 16:37:57 2017 +0000

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

diffstat:

 lib/libpthread/pthread_attr.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 131fb957115f -r 2e8086a76919 lib/libpthread/pthread_attr.c
--- a/lib/libpthread/pthread_attr.c     Sun Oct 01 10:20:40 2017 +0000
+++ b/lib/libpthread/pthread_attr.c     Sun Oct 01 16:37:57 2017 +0000
@@ -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 @@
        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;
 }



Home | Main Index | Thread Index | Old Index