comparison src/os/unix/ngx_setproctitle.c @ 42:41ccba1aba45 NGINX_0_1_21

nginx 0.1.21 *) 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 <http://sysoev.ru>
date Tue, 22 Feb 2005 00:00:00 +0300
parents 4b2dafa26fe2
children 72eb30262aac
comparison
equal deleted inserted replaced
41:4d8e7a81b3a0 42:41ccba1aba45
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