add variable var.PID for use in config file
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@698 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
parent
38b8743af3
commit
3006dd11c5
|
@ -57,6 +57,7 @@ Example
|
|||
# variables, computed when config is read.
|
||||
var.mymodule = "foo"
|
||||
server.modules += ( "mod_" + var.mymodule )
|
||||
var.PID is initized to the pid of lighttpd before config is parsed
|
||||
|
||||
# include, relative to dirname of main config file
|
||||
include "mime.types.conf"
|
||||
|
|
|
@ -900,6 +900,7 @@ static void context_free(config_t *context) {
|
|||
int config_read(server *srv, const char *fn) {
|
||||
config_t context;
|
||||
data_config *dc;
|
||||
data_integer *dpid;
|
||||
int ret;
|
||||
char *pos;
|
||||
data_array *modules;
|
||||
|
@ -929,6 +930,10 @@ int config_read(server *srv, const char *fn) {
|
|||
|
||||
/* default context */
|
||||
srv->config = dc->value;
|
||||
dpid = data_integer_init();
|
||||
dpid->value = getpid();
|
||||
buffer_copy_string(dpid->key, "var.PID");
|
||||
array_insert_unique(srv->config, (data_unset *)dpid);
|
||||
|
||||
ret = config_parse_file(srv, &context, fn);
|
||||
|
||||
|
|
Loading…
Reference in New Issue