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
4b480b48
Commit
4b480b48
authored
Oct 22, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor vut_error() into VUT_Error()
parent
820f0bb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
vut.c
lib/libvarnishapi/vut.c
+9
-18
No files found.
lib/libvarnishapi/vut.c
View file @
4b480b48
...
...
@@ -110,32 +110,23 @@ vut_dispatch(struct VSL_data *vsl, struct VSL_transaction * const trans[],
return
(
i
);
}
//lint -sem(vut_error, r_no)
static
void
v_noreturn_
v_matchproto_
(
VUT_error_f
)
vut_error
(
struct
VUT
*
vut
,
int
status
,
const
char
*
fmt
,
va_list
ap
)
{
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
fmt
);
vfprintf
(
stderr
,
fmt
,
ap
);
fprintf
(
stderr
,
"
\n
"
);
exit
(
status
);
}
void
VUT_Error
(
struct
VUT
*
vut
,
int
status
,
const
char
*
fmt
,
...)
{
va_list
ap
;
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
vut
->
error_f
);
AN
(
status
);
va_start
(
ap
,
fmt
);
if
(
vut
->
error_f
!=
NULL
)
{
vut
->
error_f
(
vut
,
status
,
fmt
,
ap
);
}
else
{
vfprintf
(
stderr
,
fmt
,
ap
);
fprintf
(
stderr
,
"
\n
"
);
}
va_end
(
ap
);
exit
(
2
);
exit
(
status
);
}
int
...
...
@@ -231,7 +222,6 @@ VUT_Init(const char *progname, int argc, char * const *argv,
vut
->
progname
=
progname
;
vut
->
g_arg
=
VSL_g_vxid
;
vut
->
k_arg
=
-
1
;
vut
->
error_f
=
vut_error
;
AZ
(
vut
->
vsl
);
vut
->
vsl
=
VSL_New
();
AN
(
vut
->
vsl
);
...
...
@@ -306,7 +296,8 @@ VUT_Setup(struct VUT *vut)
VUT_Error
(
vut
,
1
,
"PID file already created"
);
pfh
=
VPF_Open
(
vut
->
P_arg
,
0644
,
NULL
);
if
(
pfh
==
NULL
)
VUT_Error
(
vut
,
1
,
"%s: %s"
,
vut
->
P_arg
,
strerror
(
errno
));
VUT_Error
(
vut
,
1
,
"%s: %s"
,
vut
->
P_arg
,
strerror
(
errno
));
}
/* Daemon mode */
...
...
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