Commit 0f53c785 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Expose VPF_Read()

parent 3db97855
......@@ -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
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment