[apr] Fix dead nested assignments

This commit is contained in:
Andrey Volk 2022-01-07 03:09:08 +03:00
parent 6ef22a6f7d
commit d8c3595076
4 changed files with 6 additions and 8 deletions

View File

@ -730,10 +730,9 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo
APR_DECLARE(const char *) apr_proc_mutex_defname(void) APR_DECLARE(const char *) apr_proc_mutex_defname(void)
{ {
apr_status_t rv;
apr_proc_mutex_t mutex; apr_proc_mutex_t mutex;
if ((rv = proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT)) != APR_SUCCESS) { if (proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT) != APR_SUCCESS) {
return "unknown"; return "unknown";
} }
mutex.meth = mutex.inter_meth; mutex.meth = mutex.inter_meth;

View File

@ -1005,7 +1005,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap)
if (pool->user_mutex) apr_thread_mutex_lock(pool->user_mutex); if (pool->user_mutex) apr_thread_mutex_lock(pool->user_mutex);
#endif #endif
ps.node = active = pool->active; ps.node = pool->active;
ps.pool = pool; ps.pool = pool;
ps.vbuff.curpos = ps.node->first_avail; ps.vbuff.curpos = ps.node->first_avail;

View File

@ -1069,7 +1069,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
s_len = strlen(s); s_len = strlen(s);
if (alternate_form && (q = strchr(s, '.')) == NULL) { if (alternate_form && strchr(s, '.') == NULL) {
s[s_len++] = '.'; s[s_len++] = '.';
s[s_len] = '\0'; /* delimit for following strchr() */ s[s_len] = '\0'; /* delimit for following strchr() */
} }

View File

@ -369,7 +369,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
return errno; return errno;
} }
else if (new->pid == 0) { else if (new->pid == 0) {
int status;
/* child process */ /* child process */
/* /*
@ -433,7 +432,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
/* Only try to switch if we are running as root */ /* Only try to switch if we are running as root */
if (attr->gid != -1 && !geteuid()) { if (attr->gid != -1 && !geteuid()) {
if ((status = setgid(attr->gid))) { if (setgid(attr->gid)) {
if (attr->errfn) { if (attr->errfn) {
attr->errfn(pool, errno, "setting of group failed"); attr->errfn(pool, errno, "setting of group failed");
} }
@ -442,7 +441,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
} }
if (attr->uid != -1 && !geteuid()) { if (attr->uid != -1 && !geteuid()) {
if ((status = setuid(attr->uid))) { if (setuid(attr->uid)) {
if (attr->errfn) { if (attr->errfn) {
attr->errfn(pool, errno, "setting of user failed"); attr->errfn(pool, errno, "setting of user failed");
} }
@ -450,7 +449,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
} }
} }
if ((status = limit_proc(attr)) != APR_SUCCESS) { if (limit_proc(attr) != APR_SUCCESS) {
if (attr->errfn) { if (attr->errfn) {
attr->errfn(pool, errno, "setting of resource limits failed"); attr->errfn(pool, errno, "setting of resource limits failed");
} }