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
0f53c785
Commit
0f53c785
authored
Mar 27, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose VPF_Read()
parent
3db97855
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
vpf.h
include/vpf.h
+1
-0
vpf.c
lib/libvarnish/vpf.c
+3
-3
No files found.
include/vpf.h
View file @
0f53c785
...
...
@@ -36,5 +36,6 @@ struct vpf_fh *VPF_Open(const char *path, mode_t mode, pid_t *pidptr);
int
VPF_Write
(
struct
vpf_fh
*
pfh
);
int
VPF_Close
(
struct
vpf_fh
*
pfh
);
int
VPF_Remove
(
struct
vpf_fh
*
pfh
);
int
VPF_read
(
const
char
*
path
,
pid_t
*
);
#endif
lib/libvarnish/vpf.c
View file @
0f53c785
...
...
@@ -72,8 +72,8 @@ vpf_verify(const struct vpf_fh *pfh)
return
(
0
);
}
static
int
vpf
_read
(
const
char
*
path
,
pid_t
*
pidptr
)
int
VPF
_read
(
const
char
*
path
,
pid_t
*
pidptr
)
{
char
buf
[
16
],
*
endptr
;
int
error
,
fd
,
i
;
...
...
@@ -129,7 +129,7 @@ VPF_Open(const char *path, mode_t mode, pid_t *pidptr)
O_WRONLY
|
O_CREAT
|
O_TRUNC
|
O_CLOEXEC
|
O_NONBLOCK
,
mode
);
if
(
fd
==
-
1
)
{
if
(
errno
==
EWOULDBLOCK
&&
pidptr
!=
NULL
)
{
errno
=
vpf
_read
(
pfh
->
pf_path
,
pidptr
);
errno
=
VPF
_read
(
pfh
->
pf_path
,
pidptr
);
if
(
errno
==
0
)
errno
=
EEXIST
;
}
...
...
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