Don't attempt to initialize the rtld lock if it can't be malloc()'d.

PR:	83452
This commit is contained in:
Daniel Eischen 2005-08-29 13:47:42 +00:00
parent 3ff2ed9e6d
commit c7c5df6fdb
2 changed files with 14 additions and 10 deletions

View File

@ -160,11 +160,13 @@ _thr_rtld_lock_create(void)
{
struct rtld_kse_lock *l;
l = malloc(sizeof(struct rtld_kse_lock));
_lock_init(&l->lck, LCK_ADAPTIVE, _kse_lock_wait, _kse_lock_wakeup);
l->owner = NULL;
l->count = 0;
l->write = 0;
if ((l = malloc(sizeof(struct rtld_kse_lock))) != NULL) {
_lock_init(&l->lck, LCK_ADAPTIVE, _kse_lock_wait,
_kse_lock_wakeup);
l->owner = NULL;
l->count = 0;
l->write = 0;
}
return (l);
}

View File

@ -160,11 +160,13 @@ _thr_rtld_lock_create(void)
{
struct rtld_kse_lock *l;
l = malloc(sizeof(struct rtld_kse_lock));
_lock_init(&l->lck, LCK_ADAPTIVE, _kse_lock_wait, _kse_lock_wakeup);
l->owner = NULL;
l->count = 0;
l->write = 0;
if ((l = malloc(sizeof(struct rtld_kse_lock))) != NULL) {
_lock_init(&l->lck, LCK_ADAPTIVE, _kse_lock_wait,
_kse_lock_wakeup);
l->owner = NULL;
l->count = 0;
l->write = 0;
}
return (l);
}