Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
9787e415
Commit
9787e415
authored
May 31, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Namespace cleanup: vpf_* VPF_*
parent
0bf86e4b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
35 deletions
+35
-35
varnishd.c
bin/varnishd/varnishd.c
+4
-4
varnishlog.c
bin/varnishlog/varnishlog.c
+5
-5
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+4
-4
vpf.h
include/vpf.h
+5
-5
vpf.c
lib/libvarnish/vpf.c
+17
-17
No files found.
bin/varnishd/varnishd.c
View file @
9787e415
...
...
@@ -354,7 +354,7 @@ main(int argc, char * const *argv)
const
char
*
T_arg
=
NULL
;
char
*
p
,
*
vcl
=
NULL
;
struct
cli
cli
[
1
];
struct
pid
fh
*
pfh
=
NULL
;
struct
vpf_
fh
*
pfh
=
NULL
;
char
*
dirname
;
/*
...
...
@@ -590,7 +590,7 @@ main(int argc, char * const *argv)
}
/* XXX: should this be relative to the -n arg ? */
if
(
P_arg
&&
(
pfh
=
vpf_o
pen
(
P_arg
,
0644
,
NULL
))
==
NULL
)
{
if
(
P_arg
&&
(
pfh
=
VPF_O
pen
(
P_arg
,
0644
,
NULL
))
==
NULL
)
{
perror
(
P_arg
);
exit
(
1
);
}
...
...
@@ -620,7 +620,7 @@ main(int argc, char * const *argv)
mgt_SHM_Pid
();
if
(
pfh
!=
NULL
&&
vpf_w
rite
(
pfh
))
if
(
pfh
!=
NULL
&&
VPF_W
rite
(
pfh
))
fprintf
(
stderr
,
"NOTE: Could not write PID file
\n
"
);
if
(
d_flag
)
...
...
@@ -647,6 +647,6 @@ main(int argc, char * const *argv)
MGT_Run
();
if
(
pfh
!=
NULL
)
(
void
)
vpf_r
emove
(
pfh
);
(
void
)
VPF_R
emove
(
pfh
);
exit
(
exit_status
);
}
bin/varnishlog/varnishlog.c
View file @
9787e415
...
...
@@ -277,7 +277,7 @@ main(int argc, char * const *argv)
int
a_flag
=
0
,
D_flag
=
0
,
O_flag
=
0
,
u_flag
=
0
,
m_flag
=
0
;
const
char
*
P_arg
=
NULL
;
const
char
*
w_arg
=
NULL
;
struct
pid
fh
*
pfh
=
NULL
;
struct
vpf_
fh
*
pfh
=
NULL
;
struct
VSM_data
*
vd
;
vd
=
VSM_New
();
...
...
@@ -334,7 +334,7 @@ main(int argc, char * const *argv)
if
(
VSL_Open
(
vd
,
1
))
exit
(
1
);
if
(
P_arg
&&
(
pfh
=
vpf_o
pen
(
P_arg
,
0644
,
NULL
))
==
NULL
)
{
if
(
P_arg
&&
(
pfh
=
VPF_O
pen
(
P_arg
,
0644
,
NULL
))
==
NULL
)
{
perror
(
P_arg
);
exit
(
1
);
}
...
...
@@ -342,12 +342,12 @@ main(int argc, char * const *argv)
if
(
D_flag
&&
varnish_daemon
(
0
,
0
)
==
-
1
)
{
perror
(
"daemon()"
);
if
(
pfh
!=
NULL
)
vpf_r
emove
(
pfh
);
VPF_R
emove
(
pfh
);
exit
(
1
);
}
if
(
pfh
!=
NULL
)
vpf_w
rite
(
pfh
);
VPF_W
rite
(
pfh
);
if
(
w_arg
!=
NULL
)
do_write
(
vd
,
w_arg
,
a_flag
);
...
...
@@ -366,6 +366,6 @@ main(int argc, char * const *argv)
}
if
(
pfh
!=
NULL
)
vpf_r
emove
(
pfh
);
VPF_R
emove
(
pfh
);
exit
(
0
);
}
bin/varnishncsa/varnishncsa.c
View file @
9787e415
...
...
@@ -722,7 +722,7 @@ main(int argc, char *argv[])
int
a_flag
=
0
,
D_flag
=
0
,
format_flag
=
0
;
const
char
*
P_arg
=
NULL
;
const
char
*
w_arg
=
NULL
;
struct
pid
fh
*
pfh
=
NULL
;
struct
vpf_
fh
*
pfh
=
NULL
;
FILE
*
of
;
format
=
"%h %l %u %t
\"
%r
\"
%s %b
\"
%{Referer}i
\"
\"
%{User-agent}i
\"
"
;
...
...
@@ -791,7 +791,7 @@ main(int argc, char *argv[])
if
(
VSL_Open
(
vd
,
1
))
exit
(
1
);
if
(
P_arg
&&
(
pfh
=
vpf_o
pen
(
P_arg
,
0644
,
NULL
))
==
NULL
)
{
if
(
P_arg
&&
(
pfh
=
VPF_O
pen
(
P_arg
,
0644
,
NULL
))
==
NULL
)
{
perror
(
P_arg
);
exit
(
1
);
}
...
...
@@ -799,12 +799,12 @@ main(int argc, char *argv[])
if
(
D_flag
&&
varnish_daemon
(
0
,
0
)
==
-
1
)
{
perror
(
"daemon()"
);
if
(
pfh
!=
NULL
)
vpf_r
emove
(
pfh
);
VPF_R
emove
(
pfh
);
exit
(
1
);
}
if
(
pfh
!=
NULL
)
vpf_w
rite
(
pfh
);
VPF_W
rite
(
pfh
);
if
(
w_arg
)
{
of
=
open_log
(
w_arg
,
a_flag
);
...
...
include/vpf.h
View file @
9787e415
...
...
@@ -30,11 +30,11 @@
#ifndef VPF_H_INCLUDED
#define VPF_H_INCLUDED
struct
pid
fh
;
struct
vpf_
fh
;
struct
pidfh
*
vpf_o
pen
(
const
char
*
path
,
mode_t
mode
,
pid_t
*
pidptr
);
int
vpf_write
(
struct
pid
fh
*
pfh
);
int
vpf_close
(
struct
pid
fh
*
pfh
);
int
vpf_remove
(
struct
pid
fh
*
pfh
);
struct
vpf_fh
*
VPF_O
pen
(
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
);
#endif
lib/libvarnish/vpf.c
View file @
9787e415
...
...
@@ -43,17 +43,17 @@
#include "flopen.h"
#include "vpf.h"
struct
pid
fh
{
struct
vpf_
fh
{
int
pf_fd
;
char
pf_path
[
MAXPATHLEN
+
1
];
dev_t
pf_dev
;
ino_t
pf_ino
;
};
static
int
_
vpf_remove
(
struct
pid
fh
*
pfh
,
int
freeit
);
static
int
_
VPF_Remove
(
struct
vpf_
fh
*
pfh
,
int
freeit
);
static
int
vpf_verify
(
const
struct
pid
fh
*
pfh
)
vpf_verify
(
const
struct
vpf_
fh
*
pfh
)
{
struct
stat
sb
;
...
...
@@ -93,10 +93,10 @@ vpf_read(const char *path, pid_t *pidptr)
return
(
0
);
}
struct
pid
fh
*
vpf_o
pen
(
const
char
*
path
,
mode_t
mode
,
pid_t
*
pidptr
)
struct
vpf_
fh
*
VPF_O
pen
(
const
char
*
path
,
mode_t
mode
,
pid_t
*
pidptr
)
{
struct
pid
fh
*
pfh
;
struct
vpf_
fh
*
pfh
;
struct
stat
sb
;
int
error
,
fd
,
len
;
...
...
@@ -124,8 +124,8 @@ vpf_open(const char *path, mode_t mode, pid_t *pidptr)
/*
* Open the PID file and obtain exclusive lock.
* We truncate PID file here only to remove old PID immediatelly,
* PID file will be truncated again in
vpf_w
rite(), so
*
vpf_w
rite() can be called multiple times.
* PID file will be truncated again in
VPF_W
rite(), so
*
VPF_W
rite() can be called multiple times.
*/
fd
=
flopen
(
pfh
->
pf_path
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
|
O_NONBLOCK
,
mode
);
...
...
@@ -139,7 +139,7 @@ vpf_open(const char *path, mode_t mode, pid_t *pidptr)
return
(
NULL
);
}
/*
* Remember file information, so in
vpf_w
rite() we are sure we write
* Remember file information, so in
VPF_W
rite() we are sure we write
* to the proper descriptor.
*/
if
(
fstat
(
fd
,
&
sb
)
==
-
1
)
{
...
...
@@ -159,7 +159,7 @@ vpf_open(const char *path, mode_t mode, pid_t *pidptr)
}
int
vpf_write
(
struct
pid
fh
*
pfh
)
VPF_Write
(
struct
vpf_
fh
*
pfh
)
{
char
pidstr
[
16
];
int
error
,
fd
;
...
...
@@ -178,11 +178,11 @@ vpf_write(struct pidfh *pfh)
fd
=
pfh
->
pf_fd
;
/*
* Truncate PID file, so multiple calls of
vpf_w
rite() are allowed.
* Truncate PID file, so multiple calls of
VPF_W
rite() are allowed.
*/
if
(
ftruncate
(
fd
,
0
)
==
-
1
)
{
error
=
errno
;
(
void
)
_
vpf_r
emove
(
pfh
,
0
);
(
void
)
_
VPF_R
emove
(
pfh
,
0
);
errno
=
error
;
return
(
-
1
);
}
...
...
@@ -191,7 +191,7 @@ vpf_write(struct pidfh *pfh)
assert
(
error
<
sizeof
pidstr
);
if
(
pwrite
(
fd
,
pidstr
,
strlen
(
pidstr
),
0
)
!=
(
ssize_t
)
strlen
(
pidstr
))
{
error
=
errno
;
(
void
)
_
vpf_r
emove
(
pfh
,
0
);
(
void
)
_
VPF_R
emove
(
pfh
,
0
);
errno
=
error
;
return
(
-
1
);
}
...
...
@@ -200,7 +200,7 @@ vpf_write(struct pidfh *pfh)
}
int
vpf_close
(
struct
pid
fh
*
pfh
)
VPF_Close
(
struct
vpf_
fh
*
pfh
)
{
int
error
;
...
...
@@ -221,7 +221,7 @@ vpf_close(struct pidfh *pfh)
}
static
int
_
vpf_remove
(
struct
pid
fh
*
pfh
,
int
freeit
)
_
VPF_Remove
(
struct
vpf_
fh
*
pfh
,
int
freeit
)
{
int
error
;
...
...
@@ -249,8 +249,8 @@ _vpf_remove(struct pidfh *pfh, int freeit)
}
int
vpf_remove
(
struct
pid
fh
*
pfh
)
VPF_Remove
(
struct
vpf_
fh
*
pfh
)
{
return
(
_
vpf_r
emove
(
pfh
,
1
));
return
(
_
VPF_R
emove
(
pfh
,
1
));
}
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