Mercurial > hg > nginx
comparison src/os/unix/ngx_setproctitle.h @ 5826:16013b71feed
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 08 Sep 2014 21:36:09 +0400 |
parents | d620f497c50f |
children |
comparison
equal
deleted
inserted
replaced
5825:51fe42cc7876 | 5826:16013b71feed |
---|---|
11 | 11 |
12 #if (NGX_HAVE_SETPROCTITLE) | 12 #if (NGX_HAVE_SETPROCTITLE) |
13 | 13 |
14 /* FreeBSD, NetBSD, OpenBSD */ | 14 /* FreeBSD, NetBSD, OpenBSD */ |
15 | 15 |
16 #define ngx_init_setproctitle(log) | 16 #define ngx_init_setproctitle(log) NGX_OK |
17 #define ngx_setproctitle(title) setproctitle("%s", title) | 17 #define ngx_setproctitle(title) setproctitle("%s", title) |
18 | 18 |
19 | 19 |
20 #else /* !NGX_HAVE_SETPROCTITLE */ | 20 #else /* !NGX_HAVE_SETPROCTITLE */ |
21 | 21 |
37 ngx_int_t ngx_init_setproctitle(ngx_log_t *log); | 37 ngx_int_t ngx_init_setproctitle(ngx_log_t *log); |
38 void ngx_setproctitle(char *title); | 38 void ngx_setproctitle(char *title); |
39 | 39 |
40 #else | 40 #else |
41 | 41 |
42 #define ngx_init_setproctitle(log) | 42 #define ngx_init_setproctitle(log) NGX_OK |
43 #define ngx_setproctitle(title) | 43 #define ngx_setproctitle(title) |
44 | 44 |
45 #endif /* OSes */ | 45 #endif /* OSes */ |
46 | 46 |
47 #endif /* NGX_SETPROCTITLE_USES_ENV */ | 47 #endif /* NGX_SETPROCTITLE_USES_ENV */ |