Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
c012d86e
Commit
c012d86e
authored
Oct 09, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup VSUB_ and eliminate from libvarnish.h
parent
7ce0d474
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
17 deletions
+50
-17
mgt_vcc.c
bin/varnishd/mgt_vcc.c
+4
-3
Makefile.am
include/Makefile.am
+1
-0
libvarnish.h
include/libvarnish.h
+0
-5
vsub.h
include/vsub.h
+35
-0
Makefile.am
lib/libvarnish/Makefile.am
+1
-1
vsub.c
lib/libvarnish/vsub.c
+9
-8
No files found.
bin/varnishd/mgt_vcc.c
View file @
c012d86e
...
...
@@ -42,6 +42,7 @@
#include "libvcl.h"
#include "vcli.h"
#include "vsub.h"
#include "vcl.h"
#include "cli_priv.h"
#include "mgt_cli.h"
...
...
@@ -238,7 +239,7 @@ mgt_run_cc(const char *vcl, struct vsb *sb, int C_flag)
vp
.
magic
=
VCC_PRIV_MAGIC
;
vp
.
sf
=
sf
;
vp
.
vcl
=
vcl
;
if
(
SUB_run
(
sb
,
run_vcc
,
&
vp
,
"VCC-compiler"
,
-
1
))
{
if
(
V
SUB_run
(
sb
,
run_vcc
,
&
vp
,
"VCC-compiler"
,
-
1
))
{
(
void
)
unlink
(
sf
);
return
(
NULL
);
}
...
...
@@ -261,13 +262,13 @@ mgt_run_cc(const char *vcl, struct vsb *sb, int C_flag)
cmdsb
=
mgt_make_cc_cmd
(
sf
,
of
);
/* Run the C-compiler in a sub-shell */
i
=
SUB_run
(
sb
,
run_cc
,
VSB_data
(
cmdsb
),
"C-compiler"
,
10
);
i
=
V
SUB_run
(
sb
,
run_cc
,
VSB_data
(
cmdsb
),
"C-compiler"
,
10
);
(
void
)
unlink
(
sf
);
VSB_delete
(
cmdsb
);
if
(
!
i
)
i
=
SUB_run
(
sb
,
run_dlopen
,
of
,
"dlopen"
,
10
);
i
=
V
SUB_run
(
sb
,
run_dlopen
,
of
,
"dlopen"
,
10
);
if
(
i
)
{
(
void
)
unlink
(
of
);
...
...
include/Makefile.am
View file @
c012d86e
...
...
@@ -54,6 +54,7 @@ nobase_noinst_HEADERS = \
vrt.h
\
vrt_obj.h
\
vsb.h
\
vsub.h
\
vsha256.h
\
vss.h
\
vtcp.h
...
...
include/libvarnish.h
View file @
c012d86e
...
...
@@ -41,11 +41,6 @@ struct vsb;
/* from libvarnish/num.c */
const
char
*
str2bytes
(
const
char
*
p
,
uintmax_t
*
r
,
uintmax_t
rel
);
/* from libvarnish/subproc.c */
typedef
void
sub_func_f
(
void
*
);
int
SUB_run
(
struct
vsb
*
sb
,
sub_func_f
*
func
,
void
*
priv
,
const
char
*
name
,
int
maxlines
);
/* from libvarnish/time.c */
#define TIM_FORMAT_SIZE 30
void
TIM_format
(
double
t
,
char
*
p
);
...
...
include/vsub.h
0 → 100644
View file @
c012d86e
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2011 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
/* from libvarnish/subproc.c */
typedef
void
vsub_func_f
(
void
*
);
int
VSUB_run
(
struct
vsb
*
sb
,
vsub_func_f
*
func
,
void
*
priv
,
const
char
*
name
,
int
maxlines
);
lib/libvarnish/Makefile.am
View file @
c012d86e
...
...
@@ -8,7 +8,7 @@ libvarnish_la_SOURCES = \
vav.c
\
vas.c
\
binary_heap.c
\
subproc
.c
\
vsub
.c
\
cli_auth.c
\
cli_common.c
\
cli_serve.c
\
...
...
lib/libvarnish/
subproc
.c
→
lib/libvarnish/
vsub
.c
View file @
c012d86e
...
...
@@ -38,11 +38,12 @@
#include <sys/wait.h>
#include "v
sb
.h"
#include "v
as
.h"
#include "vlu.h"
#include "libvarnish.h"
#include "vsb.h"
#include "vsub.h"
struct
sub_priv
{
struct
v
sub_priv
{
const
char
*
name
;
struct
vsb
*
sb
;
int
lines
;
...
...
@@ -50,9 +51,9 @@ struct sub_priv {
};
static
int
sub_vlu
(
void
*
priv
,
const
char
*
str
)
v
sub_vlu
(
void
*
priv
,
const
char
*
str
)
{
struct
sub_priv
*
sp
;
struct
v
sub_priv
*
sp
;
sp
=
priv
;
if
(
!
sp
->
lines
++
)
...
...
@@ -63,13 +64,13 @@ sub_vlu(void *priv, const char *str)
}
int
SUB_run
(
struct
vsb
*
sb
,
sub_func_f
*
func
,
void
*
priv
,
const
char
*
name
,
VSUB_run
(
struct
vsb
*
sb
,
v
sub_func_f
*
func
,
void
*
priv
,
const
char
*
name
,
int
maxlines
)
{
int
rv
,
p
[
2
],
sfd
,
status
;
pid_t
pid
;
struct
vlu
*
vlu
;
struct
sub_priv
sp
;
struct
v
sub_priv
sp
;
sp
.
sb
=
sb
;
sp
.
name
=
name
;
...
...
@@ -102,7 +103,7 @@ SUB_run(struct vsb *sb, sub_func_f *func, void *priv, const char *name,
_exit
(
1
);
}
AZ
(
close
(
p
[
1
]));
vlu
=
VLU_New
(
&
sp
,
sub_vlu
,
0
);
vlu
=
VLU_New
(
&
sp
,
v
sub_vlu
,
0
);
while
(
!
VLU_Fd
(
p
[
0
],
vlu
))
continue
;
AZ
(
close
(
p
[
0
]));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment