diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-07-11 10:46:21 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-07-11 10:46:21 +0000 |
commit | d2d6bd5af6e5c28be22912ca815528392c9abdc5 (patch) | |
tree | d195eba7f2f5bf2b730101b6dbb3fe4216fb6826 /src | |
parent | d2c996a57c33de55a1a1975a062e43c8e7811350 (diff) | |
download | nginx-d2d6bd5af6e5c28be22912ca815528392c9abdc5.tar.gz nginx-d2d6bd5af6e5c28be22912ca815528392c9abdc5.zip |
reset errno
Diffstat (limited to 'src')
-rw-r--r-- | src/core/nginx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index 357b1b9cd..df6c72cfd 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -796,6 +796,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf) if (ccf->user == (uid_t) NGX_CONF_UNSET_UINT && geteuid() == 0) { + ngx_set_errno(0); pwd = getpwnam(NGX_USER); if (pwd == NULL) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, @@ -806,6 +807,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf) ccf->username = NGX_USER; ccf->user = pwd->pw_uid; + ngx_set_errno(0); grp = getgrnam(NGX_GROUP); if (grp == NULL) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, @@ -920,6 +922,7 @@ ngx_set_user(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ccf->username = (char *) value[1].data; + ngx_set_errno(0); pwd = getpwnam((const char *) value[1].data); if (pwd == NULL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno, @@ -931,6 +934,7 @@ ngx_set_user(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) group = (char *) ((cf->args->nelts == 2) ? value[1].data : value[2].data); + ngx_set_errno(0); grp = getgrnam(group); if (grp == NULL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno, |