[master] 0f53c78 Expose VPF_Read()
Poul-Henning Kamp
phk at FreeBSD.org
Tue Mar 27 11:48:11 UTC 2018
commit 0f53c785d4e815cc2800eec24a7fd008f47ef35f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Mar 27 11:11:34 2018 +0000
Expose VPF_Read()
diff --git a/include/vpf.h b/include/vpf.h
index 822f2d3..d5266ac 100644
--- a/include/vpf.h
+++ b/include/vpf.h
@@ -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
diff --git a/lib/libvarnish/vpf.c b/lib/libvarnish/vpf.c
index 5626b9e..915a028 100644
--- a/lib/libvarnish/vpf.c
+++ b/lib/libvarnish/vpf.c
@@ -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;
}
More information about the varnish-commit
mailing list