From e9a27dd73db571437eb6d931e6142a039374bd74 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 7 Jan 2008 20:23:50 +0000 Subject: [PATCH] DEVEL15-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 e8bed09f2..6b6f2cd01 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -342,7 +342,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 811fd9216..b28f55e31 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -384,7 +384,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; @@ -415,7 +418,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++) @@ -437,7 +443,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); @@ -458,7 +467,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