From b41a35800b6b1e11eacd6c6b2bea819aafe3d8ff Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 27 Apr 2012 09:38:25 +0200 Subject: [PATCH] Fix ucred reference counting --- rtemsbsd/src/rtems-bsd-thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rtemsbsd/src/rtems-bsd-thread.c b/rtemsbsd/src/rtems-bsd-thread.c index e8165703..f6b9abf1 100644 --- a/rtemsbsd/src/rtems-bsd-thread.c +++ b/rtemsbsd/src/rtems-bsd-thread.c @@ -49,7 +49,9 @@ RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_thread_chain); /* FIXME: What to do with the credentials? */ -static struct ucred FIXME_ucred; +static struct ucred FIXME_ucred = { + .cr_ref = 1 +}; static int rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg, int flags, int pages, const char *fmt, va_list ap) @@ -105,7 +107,7 @@ rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg, td->td_id = id; vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap); - td->td_ucred = &FIXME_ucred; + td->td_ucred = crhold(&FIXME_ucred); rtems_chain_append(&rtems_bsd_thread_chain, &td->td_node);