Commit a5f1690b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Introduce VSL_Close() function so the same process can check

multiple varnish's shmem sequentially.

Eventually, we may want to have a descriptor so one process can
check multiple varnish's shmem at the same time.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3975 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent eea7e8b4
......@@ -57,6 +57,7 @@ void VSL_NonBlocking(struct VSL_data *vd, int nb);
int VSL_Dispatch(struct VSL_data *vd, vsl_handler *func, void *priv);
int VSL_NextLog(struct VSL_data *lh, unsigned char **pp);
int VSL_Arg(struct VSL_data *vd, int arg, const char *opt);
void VSL_Close(void);
struct varnish_stats *VSL_OpenStats(const char *varnish_name);
const char *VSL_Name(void);
extern const char *VSL_tags[256];
......
......@@ -560,6 +560,18 @@ VSL_OpenStats(const char *varnish_name)
return (&vsl_lh->stats);
}
void
VSL_Close(void)
{
if (vsl_lh == NULL)
return;
assert(0 == munmap(vsl_lh, vsl_lh->size + sizeof *vsl_lh));
vsl_lh = NULL;
assert(vsl_fd >= 0);
assert(0 == close(vsl_fd));
vsl_fd = -1;
}
const char *
VSL_Name(void)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment