if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,
ngx_fd_info_n " \"%s\" failed", file.data);
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
start = ngx_pnalloc(cf->pool, size);
if (start == NULL) {
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
ngx_read_fd_n " \"%s\" failed", file.data);
- ngx_close_file(fd);
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
ngx_read_fd_n " has read only %z of %O from \"%s\"",
n, size, file.data);
- ngx_close_file(fd);
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,
ngx_fd_info_n " \"%s\" failed", file.data);
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
start = ngx_pnalloc(cf->pool, size);
if (start == NULL) {
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
ngx_read_fd_n " \"%s\" failed", file.data);
- ngx_close_file(fd);
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
if ((size_t) n != size) {
ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
- ngx_read_fd_n " has read only %z of %O from \"%s\"",
+ ngx_read_fd_n " has read only %z of %uz from \"%s\"",
n, size, file.data);
- ngx_close_file(fd);
+ (void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}