diff options
| author | Noriko Hosoi <nhosoi@redhat.com> | 2007-10-18 00:08:38 +0000 |
|---|---|---|
| committer | Noriko Hosoi <nhosoi@redhat.com> | 2007-10-18 00:08:38 +0000 |
| commit | 19cd513a509aa6e45361df774e74f2d39451e08a (patch) | |
| tree | 13ad0e58a486afd842559e1d74d019190c3f1d79 /lib/base | |
| parent | 878c163528ed089dae1edb8295a6dd4ae842b9b4 (diff) | |
Resolves: #188320
Summary: HP-UX: warnings reported by the HP-UX compiler
Diffstat (limited to 'lib/base')
| -rw-r--r-- | lib/base/crit.cpp | 14 | ||||
| -rw-r--r-- | lib/base/file.cpp | 8 |
2 files changed, 7 insertions, 15 deletions
diff --git a/lib/base/crit.cpp b/lib/base/crit.cpp index 3e057494..1a1286c2 100644 --- a/lib/base/crit.cpp +++ b/lib/base/crit.cpp @@ -150,7 +150,6 @@ NSAPI_PUBLIC void crit_exit(CRITICAL id) crit->owner = 0; PR_Unlock(crit->lock); } - PR_ASSERT(crit->count >= 0); #endif } @@ -346,9 +345,9 @@ NSAPI_PUBLIC int cs_wait(COUNTING_SEMAPHORE csp) { counting_sem_t *cs = (counting_sem_t *)csp; +#if defined(SOLARIS) && defined(HW_THREADS) int ret; -#if defined(SOLARIS) && defined(HW_THREADS) if ( (ret = sema_wait(cs)) < 0 ) { ereport(LOG_FAILURE, XP_GetAdminStr(DBT_csWaitFailureS_), system_errmsg()); return -1; @@ -366,7 +365,7 @@ cs_wait(COUNTING_SEMAPHORE csp) crit_exit(cs->cv_lock); crit_enter(cs->lock); } - ret = --(cs->count); + --(cs->count); crit_exit(cs->lock); return 0; @@ -377,18 +376,19 @@ NSAPI_PUBLIC int cs_trywait(COUNTING_SEMAPHORE csp) { counting_sem_t *cs = (counting_sem_t *)csp; - int ret; #if defined(SOLARIS) && defined(HW_THREADS) + int ret; ret = sema_trywait(cs)?-1:0; return ret; #elif defined(IRIX) && defined(HW_THREADS) + int ret; ret = uscpsema(cs); return (ret == 1)?0:-1; #else crit_enter(cs->lock); if (cs->count > 0) { - ret = --(cs->count); + --(cs->count); crit_exit(cs->lock); return 0; } @@ -402,9 +402,9 @@ NSAPI_PUBLIC int cs_release(COUNTING_SEMAPHORE csp) { counting_sem_t *cs = (counting_sem_t *)csp; - int ret; #if defined(SOLARIS) && defined(HW_THREADS) + int ret; if ( (ret = sema_post(cs)) < 0 ) { ereport(LOG_FAILURE, XP_GetAdminStr(DBT_csPostFailureS_), system_errmsg()); return -1; @@ -415,7 +415,7 @@ cs_release(COUNTING_SEMAPHORE csp) return 0; #else crit_enter(cs->lock); - ret = ++(cs->count); + ++(cs->count); if (cs->count == 1) { crit_enter(cs->cv_lock); condvar_notify(cs->cv); diff --git a/lib/base/file.cpp b/lib/base/file.cpp index 0e9e87ec..c7a1a9e2 100644 --- a/lib/base/file.cpp +++ b/lib/base/file.cpp @@ -565,19 +565,11 @@ NSAPI_PUBLIC int system_errmsg_fn(char **buff, size_t maxlen) char static_error[128]; char *lmsg = 0; /* Local message pointer */ size_t msglen = 0; - int sys_error = 0; PRErrorCode nscp_error; #ifdef XP_WIN32 LPTSTR sysmsg = 0; #endif - - /* Grab the OS error message */ -#ifdef XP_WIN32 - sys_error = GetLastError(); -#else - sys_error = errno; -#endif nscp_error = PR_GetError(); /* If there is a NSPR error, but it is "unknown", try to get the OSError |
