Klaus Demo nginx / fc514f1
fix posix_memalign() error handling Igor Sysoev 12 years ago
1 changed file(s) with 6 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
5050 ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
5151 {
5252 void *p;
53 int err;
5354
54 if (posix_memalign(&p, alignment, size) == -1) {
55 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
55 err = posix_memalign(&p, alignment, size);
56
57 if (err) {
58 ngx_log_error(NGX_LOG_EMERG, log, err,
5659 "posix_memalign() %uz bytes aligned to %uz failed",
5760 size, alignment);
61 p = NULL;
5862 }
5963
6064 ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0,