mirror of
https://github.com/nginx/nginx.git
synced 2026-06-25 11:26:50 +00:00
Added ngx_init_setproctitle() return code check.
The ngx_init_setproctitle() function, as used on systems without setproctitle(3), may fail due to memory allocation errors, and therefore its return code needs to be checked. Reported by Markus Linnala.
This commit is contained in:
parent
90df702bf8
commit
cb8a0327ab
2 changed files with 5 additions and 3 deletions
|
|
@ -40,7 +40,9 @@ ngx_os_init(ngx_log_t *log)
|
|||
}
|
||||
#endif
|
||||
|
||||
ngx_init_setproctitle(log);
|
||||
if (ngx_init_setproctitle(log) != NGX_OK) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
ngx_pagesize = getpagesize();
|
||||
ngx_cacheline_size = NGX_CPU_CACHE_LINE;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
/* FreeBSD, NetBSD, OpenBSD */
|
||||
|
||||
#define ngx_init_setproctitle(log)
|
||||
#define ngx_init_setproctitle(log) NGX_OK
|
||||
#define ngx_setproctitle(title) setproctitle("%s", title)
|
||||
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ void ngx_setproctitle(char *title);
|
|||
|
||||
#else
|
||||
|
||||
#define ngx_init_setproctitle(log)
|
||||
#define ngx_init_setproctitle(log) NGX_OK
|
||||
#define ngx_setproctitle(title)
|
||||
|
||||
#endif /* OSes */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue