From 0c72c9913e948212fed09c10bf0875d1041ff466 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 7 Jan 2008 20:25:41 +0000 Subject: [PATCH] STABLE14-viced-hpr-error-handling-20080107 LICENSE IPL10 fix ubik reinit issue reported by jhutz@cs (cherry picked from commit be4da54fa06c0a6f43c0be09e1339d29cc4b5e5a) --- src/viced/afsfileprocs.c | 3 ++- src/viced/host.c | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 105ee0ff6..9460664a5 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -340,7 +340,8 @@ CallPreamble(register struct rx_call *acall, int activecall, hpr_End(uclient); code = hpr_Initialize(&uclient); - assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + if (!code) + assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); H_LOCK; #else code = pr_Initialize(2, AFSDIR_SERVER_ETC_DIRPATH, 0); diff --git a/src/viced/host.c b/src/viced/host.c index cc36eca21..bb80cdfc4 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -375,7 +375,10 @@ hpr_GetHostCPS(afs_int32 host, prlist *CPS) if (!uclient) { code = hpr_Initialize(&uclient); - assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + if (!code) + assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + else + return code; } over = 0; @@ -406,7 +409,10 @@ hpr_NameToId(namelist *names, idlist *ids) if (!uclient) { code = hpr_Initialize(&uclient); - assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + if (!code) + assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + else + return code; } for (i = 0; i < names->namelist_len; i++) @@ -428,7 +434,10 @@ hpr_IdToName(idlist *ids, namelist *names) if (!uclient) { code = hpr_Initialize(&uclient); - assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + if (!code) + assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + else + return code; } code = ubik_PR_IDToName(uclient, 0, ids, names); @@ -449,7 +458,10 @@ hpr_GetCPS(afs_int32 id, prlist *CPS) if (!uclient) { code = hpr_Initialize(&uclient); - assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + if (!code) + assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0); + else + return code; } over = 0; -- 2.39.5