flid_t osi_flid;
#endif
+struct AFS_UCRED *afs_osi_credp;
+
void
osi_Init(void)
{
#endif /* AFS_HPUX_ENV */
if (!afs_osicred_initialized) {
- memset(&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
-#ifdef AFS_FBSD50_ENV
- /*
- * We don't init the mutex.
- * This will be trouble if anyone tries to use change the refcount.
- * Proper fix would be to make afs_osi_cred into a pointer,
- * and crdup() it from curthread.
- */
- afs_osi_cred.cr_ref = 1;
+#ifdef AFS_XBSD_ENV
+ /* Can't just invent one, must use crget() because of mutex */
+ afs_osi_credp = crdup(osi_curcred());
#else
+ memset(&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate */
+ afs_osi_credp = &afs_osi_cred;
#endif
afs_osicred_initialized = 1;
}