Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
becd087d
Commit
becd087d
authored
Sep 11, 2017
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slap a magic number in struct VUT
parent
8e09fd8b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
16 deletions
+15
-16
varnishlog.c
bin/varnishlog/varnishlog.c
+1
-1
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+1
-1
varnishtop.c
bin/varnishtop/varnishtop.c
+2
-1
vut.h
include/vut.h
+2
-0
vut.c
lib/libvarnishapi/vut.c
+9
-13
No files found.
bin/varnishlog/varnishlog.c
View file @
becd087d
...
...
@@ -122,7 +122,7 @@ sighup(struct VUT *v)
static
void
vut_sighandler
(
int
sig
)
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
VUT_Signaled
(
vut
,
sig
);
}
...
...
bin/varnishncsa/varnishncsa.c
View file @
becd087d
...
...
@@ -1117,7 +1117,7 @@ sighup(struct VUT *v)
static
void
vut_sighandler
(
int
sig
)
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
VUT_Signaled
(
vut
,
sig
);
}
...
...
bin/varnishtop/varnishtop.c
View file @
becd087d
...
...
@@ -45,6 +45,7 @@
#define VOPT_DEFINITION
#define VOPT_INC "varnishtop_options.h"
#include "miniobj.h"
#include "vcurses.h"
#include "vapi/vsl.h"
#include "vapi/vsm.h"
...
...
@@ -190,7 +191,7 @@ sighup(struct VUT *v)
static
void
vut_sighandler
(
int
sig
)
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
VUT_Signaled
(
vut
,
sig
);
}
...
...
include/vut.h
View file @
becd087d
...
...
@@ -37,6 +37,8 @@ typedef int VUT_cb_f(struct VUT *);
typedef
void
VUT_error_f
(
struct
VUT
*
,
int
,
const
char
*
,
va_list
);
struct
VUT
{
unsigned
magic
;
#define VUT_MAGIC 0xdf3b3de8
const
char
*
progname
;
/* Options */
...
...
lib/libvarnishapi/vut.c
View file @
becd087d
...
...
@@ -87,8 +87,8 @@ vut_dispatch(struct VSL_data *vsl, struct VSL_transaction * const trans[],
struct
VUT
*
vut
;
int
i
;
vut
=
priv
;
AN
(
vut
);
CAST_OBJ_NOTNULL
(
vut
,
priv
,
VUT_MAGIC
)
;
if
(
vut
->
k_arg
==
0
)
return
(
-
1
);
/* End of file */
AN
(
vut
->
dispatch_f
);
...
...
@@ -105,7 +105,7 @@ static void __attribute__((__noreturn__)) __match_proto__(VUT_error_f)
vut_error
(
struct
VUT
*
vut
,
int
status
,
const
char
*
fmt
,
va_list
ap
)
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
fmt
);
vfprintf
(
stderr
,
fmt
,
ap
);
fprintf
(
stderr
,
"
\n
"
);
...
...
@@ -202,7 +202,7 @@ VUT_Init(const char *progname, int argc, char * const *argv,
AN
(
argv
);
AN
(
voc
);
vut
=
calloc
(
1
,
sizeof
*
vut
);
ALLOC_OBJ
(
vut
,
VUT_MAGIC
);
AN
(
vut
);
if
(
argc
==
2
&&
!
strcmp
(
argv
[
1
],
"--synopsis"
))
...
...
@@ -235,7 +235,7 @@ void
VUT_Signaled
(
struct
VUT
*
vut
,
int
sig
)
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
vut
->
sighup
|=
(
sig
==
SIGHUP
);
vut
->
sigint
|=
(
sig
==
SIGINT
||
sig
==
SIGTERM
);
vut
->
sigusr1
|=
(
sig
==
SIGUSR1
);
...
...
@@ -246,7 +246,7 @@ VUT_Setup(struct VUT *vut)
{
struct
VSL_cursor
*
c
;
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
vut
->
vsl
);
AZ
(
vut
->
vsm
);
AZ
(
vut
->
vslq
);
...
...
@@ -307,11 +307,7 @@ VUT_Fini(struct VUT **vutp)
{
struct
VUT
*
vut
;
AN
(
vutp
);
vut
=
*
vutp
;
*
vutp
=
NULL
;
AN
(
vut
);
TAKE_OBJ_NOTNULL
(
vut
,
vutp
,
VUT_MAGIC
);
AN
(
vut
->
progname
);
free
(
vut
->
n_arg
);
...
...
@@ -331,7 +327,7 @@ VUT_Fini(struct VUT **vutp)
VSM_Destroy
(
&
vut
->
vsm
);
memset
(
vut
,
0
,
sizeof
*
vut
);
free
(
vut
);
FREE_OBJ
(
vut
);
}
int
...
...
@@ -341,7 +337,7 @@ VUT_Main(struct VUT *vut)
int
i
=
-
1
;
int
hascursor
=
-
1
;
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
vut
->
vslq
);
while
(
!
vut
->
sigint
)
{
...
...
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