Add comments in setproctitle.c
This commit is contained in:
parent
4f69d318b8
commit
e7d20623cb
@ -87,8 +87,29 @@ static char **argv1_addr = NULL;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ALLOCATE_ENVIRON
|
#if ALLOCATE_ENVIRON
|
||||||
|
/* system_environ is the value of environ before we allocate a custom buffer.
|
||||||
|
*
|
||||||
|
* We use this to restore environ in ruby_free_proctitle.
|
||||||
|
*/
|
||||||
static char **system_environ = NULL;
|
static char **system_environ = NULL;
|
||||||
|
/* orig_environ is the buffer we allocate for environ.
|
||||||
|
*
|
||||||
|
* We use this to free this buffer in ruby_free_proctitle. When we add new
|
||||||
|
* environment variables using setenv, the system may change environ to a
|
||||||
|
* different buffer and will not free the original buffer, so we need to hold
|
||||||
|
* onto this so we can free it in ruby_free_proctitle.
|
||||||
|
*
|
||||||
|
* We must not free any of the contents because it may change if the system
|
||||||
|
* updates existing environment variables.
|
||||||
|
*/
|
||||||
static char **orig_environ = NULL;
|
static char **orig_environ = NULL;
|
||||||
|
/* alloc_environ is a copy of orig_environ.
|
||||||
|
*
|
||||||
|
* We use this to free all the original string copies that were in orig_environ.
|
||||||
|
* Since environ could be changed to point to strings allocated by the system
|
||||||
|
* if environment variables are updated, so we need this to point to the
|
||||||
|
* original strings.
|
||||||
|
*/
|
||||||
static char **alloc_environ = NULL;
|
static char **alloc_environ = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user