Commit 75593811 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Bring flopen/fltest into the V* namespace

parent 1c662d99
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include "mgt/mgt.h" #include "mgt/mgt.h"
#include "common/heritage.h" #include "common/heritage.h"
#include "flopen.h" #include "vfl.h"
#include "vsm_priv.h" #include "vsm_priv.h"
#include "vmb.h" #include "vmb.h"
#include "vfil.h" #include "vfil.h"
...@@ -112,7 +112,7 @@ vsm_n_check(void) ...@@ -112,7 +112,7 @@ vsm_n_check(void)
fprintf(stderr, fprintf(stderr,
"VSM (%s) not a regular file.\n", VSM_FILENAME); "VSM (%s) not a regular file.\n", VSM_FILENAME);
} else { } else {
i = fltest(fd, &pid); i = VFL_Test(fd, &pid);
if (i < 0) { if (i < 0) {
fprintf(stderr, fprintf(stderr,
"Cannot determine locking status of VSM (%s)\n.", "Cannot determine locking status of VSM (%s)\n.",
...@@ -150,7 +150,7 @@ vsm_zerofile(const char *fn, ssize_t size) ...@@ -150,7 +150,7 @@ vsm_zerofile(const char *fn, ssize_t size)
int fd; int fd;
int flags; int flags;
fd = flopen(fn, O_RDWR | O_CREAT | O_EXCL | O_NONBLOCK, 0640); fd = VFL_Open(fn, O_RDWR | O_CREAT | O_EXCL | O_NONBLOCK, 0640);
if (fd < 0) { if (fd < 0) {
fprintf(stderr, "Could not create %s: %s\n", fprintf(stderr, "Could not create %s: %s\n",
fn, strerror(errno)); fn, strerror(errno));
......
...@@ -13,7 +13,7 @@ varnishhist_SOURCES = varnishhist.c \ ...@@ -13,7 +13,7 @@ varnishhist_SOURCES = varnishhist.c \
$(top_srcdir)/lib/libvarnish/version.c \ $(top_srcdir)/lib/libvarnish/version.c \
$(top_srcdir)/lib/libvarnish/vpf.c \ $(top_srcdir)/lib/libvarnish/vpf.c \
$(top_srcdir)/lib/libvarnish/vtim.c \ $(top_srcdir)/lib/libvarnish/vtim.c \
$(top_srcdir)/lib/libvarnish/flopen.c \ $(top_srcdir)/lib/libvarnish/vfl.c \
$(top_srcdir)/lib/libvarnishtools/vut.c $(top_srcdir)/lib/libvarnishtools/vut.c
varnishhist_CFLAGS = \ varnishhist_CFLAGS = \
......
...@@ -12,8 +12,8 @@ varnishlog_SOURCES = \ ...@@ -12,8 +12,8 @@ varnishlog_SOURCES = \
varnishlog_options.c \ varnishlog_options.c \
$(top_srcdir)/lib/libvarnishtools/vut.c \ $(top_srcdir)/lib/libvarnishtools/vut.c \
$(top_srcdir)/lib/libvarnish/vas.c \ $(top_srcdir)/lib/libvarnish/vas.c \
$(top_srcdir)/lib/libvarnish/flopen.c \
$(top_srcdir)/lib/libvarnish/version.c \ $(top_srcdir)/lib/libvarnish/version.c \
$(top_srcdir)/lib/libvarnish/vfl.c \
$(top_srcdir)/lib/libvarnish/vsb.c \ $(top_srcdir)/lib/libvarnish/vsb.c \
$(top_srcdir)/lib/libvarnish/vpf.c \ $(top_srcdir)/lib/libvarnish/vpf.c \
$(top_srcdir)/lib/libvarnish/vtim.c $(top_srcdir)/lib/libvarnish/vtim.c
......
...@@ -14,8 +14,8 @@ varnishncsa_SOURCES = \ ...@@ -14,8 +14,8 @@ varnishncsa_SOURCES = \
base64.c \ base64.c \
$(top_srcdir)/lib/libvarnishtools/vut.c \ $(top_srcdir)/lib/libvarnishtools/vut.c \
$(top_srcdir)/lib/libvarnish/vas.c \ $(top_srcdir)/lib/libvarnish/vas.c \
$(top_srcdir)/lib/libvarnish/flopen.c \
$(top_srcdir)/lib/libvarnish/version.c \ $(top_srcdir)/lib/libvarnish/version.c \
$(top_srcdir)/lib/libvarnish/vfl.c \
$(top_srcdir)/lib/libvarnish/vpf.c \ $(top_srcdir)/lib/libvarnish/vpf.c \
$(top_srcdir)/lib/libvarnish/vtim.c \ $(top_srcdir)/lib/libvarnish/vtim.c \
$(top_srcdir)/lib/libvarnish/vsb.c $(top_srcdir)/lib/libvarnish/vsb.c
......
...@@ -11,8 +11,8 @@ varnishtop_SOURCES = varnishtop.c \ ...@@ -11,8 +11,8 @@ varnishtop_SOURCES = varnishtop.c \
varnishtop_options.c \ varnishtop_options.c \
$(top_srcdir)/lib/libvarnishtools/vut.c \ $(top_srcdir)/lib/libvarnishtools/vut.c \
$(top_srcdir)/lib/libvarnish/vas.c \ $(top_srcdir)/lib/libvarnish/vas.c \
$(top_srcdir)/lib/libvarnish/flopen.c \
$(top_srcdir)/lib/libvarnish/version.c \ $(top_srcdir)/lib/libvarnish/version.c \
$(top_srcdir)/lib/libvarnish/vfl.c \
$(top_srcdir)/lib/libvarnish/vpf.c \ $(top_srcdir)/lib/libvarnish/vpf.c \
$(top_srcdir)/lib/libvarnish/vtim.c \ $(top_srcdir)/lib/libvarnish/vtim.c \
$(top_srcdir)/lib/libvarnish/vsb.c $(top_srcdir)/lib/libvarnish/vsb.c
......
...@@ -66,7 +66,7 @@ nobase_noinst_HEADERS = \ ...@@ -66,7 +66,7 @@ nobase_noinst_HEADERS = \
binary_heap.h \ binary_heap.h \
compat/daemon.h \ compat/daemon.h \
compat/execinfo.h \ compat/execinfo.h \
flopen.h \ vfl.h \
libvcc.h \ libvcc.h \
vcli_common.h \ vcli_common.h \
vcli_priv.h \ vcli_priv.h \
......
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
* $FreeBSD: src/lib/libutil/libutil.h,v 1.44 2007/05/10 15:01:42 des Exp $ * $FreeBSD: src/lib/libutil/libutil.h,v 1.44 2007/05/10 15:01:42 des Exp $
*/ */
#ifndef FLOPEN_H_INCLUDED #ifndef VFL_H_INCLUDED
#define FLOPEN_H_INCLUDED #define VFL_H_INCLUDED
int flopen(const char *, int, ...); int VFL_Open(const char *, int, ...);
int fltest(int fd, pid_t *pid); int VFL_Test(int fd, pid_t *pid);
#endif #endif
...@@ -17,7 +17,7 @@ libvarnish_la_SOURCES = \ ...@@ -17,7 +17,7 @@ libvarnish_la_SOURCES = \
cli_auth.c \ cli_auth.c \
cli_common.c \ cli_common.c \
cli_serve.c \ cli_serve.c \
flopen.c \ vfl.c \
vnum.c \ vnum.c \
vtim.c \ vtim.c \
vtcp.c \ vtcp.c \
......
...@@ -37,10 +37,10 @@ ...@@ -37,10 +37,10 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "flopen.h" #include "vfl.h"
int int
flopen(const char *path, int flags, ...) VFL_Open(const char *path, int flags, ...)
{ {
int fd, operation, serrno, trunc; int fd, operation, serrno, trunc;
struct flock lock; struct flock lock;
...@@ -115,7 +115,7 @@ flopen(const char *path, int flags, ...) ...@@ -115,7 +115,7 @@ flopen(const char *path, int flags, ...)
* Returns -1 on error (and errno) * Returns -1 on error (and errno)
*/ */
int int
fltest(int fd, pid_t *pid) VFL_Test(int fd, pid_t *pid)
{ {
struct flock lock; struct flock lock;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "flopen.h" #include "vfl.h"
#include "vas.h" #include "vas.h"
#include "vpf.h" #include "vpf.h"
...@@ -128,7 +128,7 @@ VPF_Open(const char *path, mode_t mode, pid_t *pidptr) ...@@ -128,7 +128,7 @@ VPF_Open(const char *path, mode_t mode, pid_t *pidptr)
* PID file will be truncated again in VPF_Write(), so * PID file will be truncated again in VPF_Write(), so
* VPF_Write() can be called multiple times. * VPF_Write() can be called multiple times.
*/ */
fd = flopen(pfh->pf_path, fd = VFL_Open(pfh->pf_path,
O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode); O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode);
if (fd == -1) { if (fd == -1) {
if (errno == EWOULDBLOCK && pidptr != NULL) { if (errno == EWOULDBLOCK && pidptr != NULL) {
......
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