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
Show 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)
...
@@ -122,7 +122,7 @@ sighup(struct VUT *v)
static
void
static
void
vut_sighandler
(
int
sig
)
vut_sighandler
(
int
sig
)
{
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
VUT_Signaled
(
vut
,
sig
);
VUT_Signaled
(
vut
,
sig
);
}
}
...
...
bin/varnishncsa/varnishncsa.c
View file @
becd087d
...
@@ -1117,7 +1117,7 @@ sighup(struct VUT *v)
...
@@ -1117,7 +1117,7 @@ sighup(struct VUT *v)
static
void
static
void
vut_sighandler
(
int
sig
)
vut_sighandler
(
int
sig
)
{
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
VUT_Signaled
(
vut
,
sig
);
VUT_Signaled
(
vut
,
sig
);
}
}
...
...
bin/varnishtop/varnishtop.c
View file @
becd087d
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#define VOPT_DEFINITION
#define VOPT_DEFINITION
#define VOPT_INC "varnishtop_options.h"
#define VOPT_INC "varnishtop_options.h"
#include "miniobj.h"
#include "vcurses.h"
#include "vcurses.h"
#include "vapi/vsl.h"
#include "vapi/vsl.h"
#include "vapi/vsm.h"
#include "vapi/vsm.h"
...
@@ -190,7 +191,7 @@ sighup(struct VUT *v)
...
@@ -190,7 +191,7 @@ sighup(struct VUT *v)
static
void
static
void
vut_sighandler
(
int
sig
)
vut_sighandler
(
int
sig
)
{
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
VUT_Signaled
(
vut
,
sig
);
VUT_Signaled
(
vut
,
sig
);
}
}
...
...
include/vut.h
View file @
becd087d
...
@@ -37,6 +37,8 @@ typedef int VUT_cb_f(struct VUT *);
...
@@ -37,6 +37,8 @@ typedef int VUT_cb_f(struct VUT *);
typedef
void
VUT_error_f
(
struct
VUT
*
,
int
,
const
char
*
,
va_list
);
typedef
void
VUT_error_f
(
struct
VUT
*
,
int
,
const
char
*
,
va_list
);
struct
VUT
{
struct
VUT
{
unsigned
magic
;
#define VUT_MAGIC 0xdf3b3de8
const
char
*
progname
;
const
char
*
progname
;
/* Options */
/* Options */
...
...
lib/libvarnishapi/vut.c
View file @
becd087d
...
@@ -87,8 +87,8 @@ vut_dispatch(struct VSL_data *vsl, struct VSL_transaction * const trans[],
...
@@ -87,8 +87,8 @@ vut_dispatch(struct VSL_data *vsl, struct VSL_transaction * const trans[],
struct
VUT
*
vut
;
struct
VUT
*
vut
;
int
i
;
int
i
;
vut
=
priv
;
CAST_OBJ_NOTNULL
(
vut
,
priv
,
VUT_MAGIC
)
;
AN
(
vut
);
if
(
vut
->
k_arg
==
0
)
if
(
vut
->
k_arg
==
0
)
return
(
-
1
);
/* End of file */
return
(
-
1
);
/* End of file */
AN
(
vut
->
dispatch_f
);
AN
(
vut
->
dispatch_f
);
...
@@ -105,7 +105,7 @@ static void __attribute__((__noreturn__)) __match_proto__(VUT_error_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
)
vut_error
(
struct
VUT
*
vut
,
int
status
,
const
char
*
fmt
,
va_list
ap
)
{
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
fmt
);
AN
(
fmt
);
vfprintf
(
stderr
,
fmt
,
ap
);
vfprintf
(
stderr
,
fmt
,
ap
);
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
...
@@ -202,7 +202,7 @@ VUT_Init(const char *progname, int argc, char * const *argv,
...
@@ -202,7 +202,7 @@ VUT_Init(const char *progname, int argc, char * const *argv,
AN
(
argv
);
AN
(
argv
);
AN
(
voc
);
AN
(
voc
);
vut
=
calloc
(
1
,
sizeof
*
vut
);
ALLOC_OBJ
(
vut
,
VUT_MAGIC
);
AN
(
vut
);
AN
(
vut
);
if
(
argc
==
2
&&
!
strcmp
(
argv
[
1
],
"--synopsis"
))
if
(
argc
==
2
&&
!
strcmp
(
argv
[
1
],
"--synopsis"
))
...
@@ -235,7 +235,7 @@ void
...
@@ -235,7 +235,7 @@ void
VUT_Signaled
(
struct
VUT
*
vut
,
int
sig
)
VUT_Signaled
(
struct
VUT
*
vut
,
int
sig
)
{
{
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
vut
->
sighup
|=
(
sig
==
SIGHUP
);
vut
->
sighup
|=
(
sig
==
SIGHUP
);
vut
->
sigint
|=
(
sig
==
SIGINT
||
sig
==
SIGTERM
);
vut
->
sigint
|=
(
sig
==
SIGINT
||
sig
==
SIGTERM
);
vut
->
sigusr1
|=
(
sig
==
SIGUSR1
);
vut
->
sigusr1
|=
(
sig
==
SIGUSR1
);
...
@@ -246,7 +246,7 @@ VUT_Setup(struct VUT *vut)
...
@@ -246,7 +246,7 @@ VUT_Setup(struct VUT *vut)
{
{
struct
VSL_cursor
*
c
;
struct
VSL_cursor
*
c
;
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
vut
->
vsl
);
AN
(
vut
->
vsl
);
AZ
(
vut
->
vsm
);
AZ
(
vut
->
vsm
);
AZ
(
vut
->
vslq
);
AZ
(
vut
->
vslq
);
...
@@ -307,11 +307,7 @@ VUT_Fini(struct VUT **vutp)
...
@@ -307,11 +307,7 @@ VUT_Fini(struct VUT **vutp)
{
{
struct
VUT
*
vut
;
struct
VUT
*
vut
;
AN
(
vutp
);
TAKE_OBJ_NOTNULL
(
vut
,
vutp
,
VUT_MAGIC
);
vut
=
*
vutp
;
*
vutp
=
NULL
;
AN
(
vut
);
AN
(
vut
->
progname
);
AN
(
vut
->
progname
);
free
(
vut
->
n_arg
);
free
(
vut
->
n_arg
);
...
@@ -331,7 +327,7 @@ VUT_Fini(struct VUT **vutp)
...
@@ -331,7 +327,7 @@ VUT_Fini(struct VUT **vutp)
VSM_Destroy
(
&
vut
->
vsm
);
VSM_Destroy
(
&
vut
->
vsm
);
memset
(
vut
,
0
,
sizeof
*
vut
);
memset
(
vut
,
0
,
sizeof
*
vut
);
free
(
vut
);
FREE_OBJ
(
vut
);
}
}
int
int
...
@@ -341,7 +337,7 @@ VUT_Main(struct VUT *vut)
...
@@ -341,7 +337,7 @@ VUT_Main(struct VUT *vut)
int
i
=
-
1
;
int
i
=
-
1
;
int
hascursor
=
-
1
;
int
hascursor
=
-
1
;
AN
(
vut
);
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
vut
->
vslq
);
AN
(
vut
->
vslq
);
while
(
!
vut
->
sigint
)
{
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