Mercurial > hg > nginx
comparison src/os/unix/ngx_setproctitle.c @ 493:975f62e77f02 release-0.1.21
nginx-0.1.21-RELEASE import
*) Bugfix: the ngx_http_stub_status_module showed incorrect statistics
if "rtsig" method was used or if several worker process ran on SMP.
*) Bugfix: nginx could not be built by the icc compiler on Linux or if
the zlib-1.2.x library was building from sources.
*) Bugfix: nginx could not be built on NetBSD 2.0.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 22 Feb 2005 14:40:13 +0000 |
parents | 295d97d70c69 |
children | d4ea69372b94 |
comparison
equal
deleted
inserted
replaced
492:a3fac9a5aa5b | 493:975f62e77f02 |
---|---|
28 | 28 |
29 extern char **environ; | 29 extern char **environ; |
30 | 30 |
31 static char *ngx_os_argv_last; | 31 static char *ngx_os_argv_last; |
32 | 32 |
33 ngx_int_t ngx_init_setproctitle(ngx_log_t *log) | 33 ngx_int_t |
34 ngx_init_setproctitle(ngx_log_t *log) | |
34 { | 35 { |
35 char *p; | 36 u_char *p; |
36 size_t size; | 37 size_t size; |
37 ngx_uint_t i; | 38 ngx_uint_t i; |
38 | 39 |
39 size = 0; | 40 size = 0; |
40 | 41 |
58 if (ngx_os_argv_last == environ[i]) { | 59 if (ngx_os_argv_last == environ[i]) { |
59 | 60 |
60 size = ngx_strlen(environ[i]) + 1; | 61 size = ngx_strlen(environ[i]) + 1; |
61 ngx_os_argv_last = environ[i] + size; | 62 ngx_os_argv_last = environ[i] + size; |
62 | 63 |
63 ngx_cpystrn(p, environ[i], size); | 64 ngx_cpystrn(p, (u_char *) environ[i], size); |
64 environ[i] = p; | 65 environ[i] = (char *) p; |
65 p += size; | 66 p += size; |
66 } | 67 } |
67 } | 68 } |
68 | 69 |
69 ngx_os_argv_last--; | 70 ngx_os_argv_last--; |
70 | 71 |
71 return NGX_OK; | 72 return NGX_OK; |
72 } | 73 } |
73 | 74 |
74 | 75 |
75 void ngx_setproctitle(char *title) | 76 void |
77 ngx_setproctitle(char *title) | |
76 { | 78 { |
77 u_char *p; | 79 u_char *p; |
78 | 80 |
79 #if (NGX_SOLARIS) | 81 #if (NGX_SOLARIS) |
80 | 82 |
129 } | 131 } |
130 | 132 |
131 | 133 |
132 #elif !defined(ngx_setproctitle) | 134 #elif !defined(ngx_setproctitle) |
133 | 135 |
134 ngx_int_t ngx_init_setproctitle(ngx_log_t *log) | 136 ngx_int_t |
137 ngx_init_setproctitle(ngx_log_t *log) | |
135 { | 138 { |
136 return NGX_OK; | 139 return NGX_OK; |
137 } | 140 } |
138 | 141 |
139 void ngx_setproctitle(char *title) | 142 void |
143 ngx_setproctitle(char *title) | |
140 { | 144 { |
145 return; | |
141 } | 146 } |
142 | 147 |
143 #endif | 148 #endif |