diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-04-27 09:38:25 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-10 16:20:41 +0200 |
commit | b41a35800b6b1e11eacd6c6b2bea819aafe3d8ff (patch) | |
tree | 06ba3b568b86dcee4169888eabae47d9c611fa2b | |
parent | Added subr_unit.c needed for addtional Nics. (diff) | |
download | rtems-libbsd-b41a35800b6b1e11eacd6c6b2bea819aafe3d8ff.tar.bz2 |
Fix ucred reference counting
-rw-r--r-- | rtemsbsd/src/rtems-bsd-thread.c | 6 |
1 files 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); |