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
368197ad
Commit
368197ad
authored
Oct 09, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
And now it is VNUM's turn...
parent
b37c01df
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
19 deletions
+21
-19
mgt_shmem.c
bin/varnishd/mgt_shmem.c
+3
-2
stevedore_utils.c
bin/varnishd/stevedore_utils.c
+2
-1
storage_file.c
bin/varnishd/storage_file.c
+2
-1
storage_malloc.c
bin/varnishd/storage_malloc.c
+2
-1
storage_umem.c
bin/varnishd/storage_umem.c
+1
-1
Makefile.am
include/Makefile.am
+1
-0
libvarnish.h
include/libvarnish.h
+0
-3
Makefile.am
lib/libvarnish/Makefile.am
+5
-5
vnum.c
lib/libvarnish/vnum.c
+5
-5
No files found.
bin/varnishd/mgt_shmem.c
View file @
368197ad
...
...
@@ -103,6 +103,7 @@
#include "vmb.h"
#include "vsm.h"
#include "vav.h"
#include "vnum.h"
#include "flopen.h"
#ifndef MAP_HASSEMAPHORE
...
...
@@ -244,7 +245,7 @@ mgt_SHM_Init(const char *l_arg)
/* Size of SHMLOG */
if
(
*
ap
!=
NULL
&&
**
ap
!=
'\0'
)
{
q
=
str
2bytes
(
*
ap
,
&
s1
,
0
);
q
=
VNUM_
2bytes
(
*
ap
,
&
s1
,
0
);
if
(
q
!=
NULL
)
ARGV_ERR
(
"
\t
-l[1] ...: %s
\n
"
,
q
);
}
else
{
...
...
@@ -255,7 +256,7 @@ mgt_SHM_Init(const char *l_arg)
/* Size of space for other stuff */
if
(
*
ap
!=
NULL
&&
**
ap
!=
'\0'
)
{
q
=
str
2bytes
(
*
ap
,
&
s2
,
0
);
q
=
VNUM_
2bytes
(
*
ap
,
&
s2
,
0
);
if
(
q
!=
NULL
)
ARGV_ERR
(
"
\t
-l[2] ...: %s
\n
"
,
q
);
}
else
{
...
...
bin/varnishd/stevedore_utils.c
View file @
368197ad
...
...
@@ -53,6 +53,7 @@
#include "mgt.h"
#include "stevedore.h"
#include "vnum.h"
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
...
...
@@ -197,7 +198,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
l
=
st
.
st_size
;
}
else
{
AN
(
size
);
q
=
str
2bytes
(
size
,
&
l
,
fssize
);
q
=
VNUM_
2bytes
(
size
,
&
l
,
fssize
);
if
(
q
!=
NULL
)
ARGV_ERR
(
"(%s) size
\"
%s
\"
: %s
\n
"
,
size
,
ctx
,
q
);
...
...
bin/varnishd/storage_file.c
View file @
368197ad
...
...
@@ -38,6 +38,7 @@
#include "cache.h"
#include "stevedore.h"
#include "vnum.h"
#ifndef MAP_NOCORE
#define MAP_NOCORE 0
/* XXX Linux */
...
...
@@ -131,7 +132,7 @@ smf_init(struct stevedore *parent, int ac, char * const *av)
size
=
av
[
1
];
if
(
ac
>
2
&&
*
av
[
2
]
!=
'\0'
)
{
r
=
str
2bytes
(
av
[
2
],
&
page_size
,
0
);
r
=
VNUM_
2bytes
(
av
[
2
],
&
page_size
,
0
);
if
(
r
!=
NULL
)
ARGV_ERR
(
"(-sfile) granularity
\"
%s
\"
: %s
\n
"
,
av
[
2
],
r
);
}
...
...
bin/varnishd/storage_malloc.c
View file @
368197ad
...
...
@@ -37,6 +37,7 @@
#include "cache.h"
#include "stevedore.h"
#include "vnum.h"
struct
sma_sc
{
unsigned
magic
;
...
...
@@ -216,7 +217,7 @@ sma_init(struct stevedore *parent, int ac, char * const *av)
if
(
ac
==
0
||
*
av
[
0
]
==
'\0'
)
return
;
e
=
str
2bytes
(
av
[
0
],
&
u
,
0
);
e
=
VNUM_
2bytes
(
av
[
0
],
&
u
,
0
);
if
(
e
!=
NULL
)
ARGV_ERR
(
"(-smalloc) size
\"
%s
\"
: %s
\n
"
,
av
[
0
],
e
);
if
((
u
!=
(
uintmax_t
)(
size_t
)
u
))
...
...
bin/varnishd/storage_umem.c
View file @
368197ad
...
...
@@ -140,7 +140,7 @@ smu_init(struct stevedore *parent, int ac, char * const *av)
if
(
ac
==
0
||
*
av
[
0
]
==
'\0'
)
return
;
e
=
str
2bytes
(
av
[
0
],
&
u
,
0
);
e
=
VNUM_
2bytes
(
av
[
0
],
&
u
,
0
);
if
(
e
!=
NULL
)
ARGV_ERR
(
"(-sumem) size
\"
%s
\"
: %s
\n
"
,
av
[
0
],
e
);
if
((
u
!=
(
uintmax_t
)(
size_t
)
u
))
...
...
include/Makefile.am
View file @
368197ad
...
...
@@ -48,6 +48,7 @@ nobase_noinst_HEADERS = \
vlu.h
\
vmb.h
\
vmod_abi.h
\
vnum.h
\
vpf.h
\
vqueue.h
\
vre.h
\
...
...
include/libvarnish.h
View file @
368197ad
...
...
@@ -38,9 +38,6 @@
struct
vsb
;
/* from libvarnish/num.c */
const
char
*
str2bytes
(
const
char
*
p
,
uintmax_t
*
r
,
uintmax_t
rel
);
/* from libvarnish/version.c */
void
VCS_Message
(
const
char
*
);
...
...
lib/libvarnish/Makefile.am
View file @
368197ad
...
...
@@ -13,7 +13,7 @@ libvarnish_la_SOURCES = \
cli_common.c
\
cli_serve.c
\
flopen.c
\
num.c
\
v
num.c
\
vtim.c
\
vtcp.c
\
vct.c
\
...
...
@@ -33,13 +33,13 @@ libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
libvarnish_la_LIBADD
=
${
RT_LIBS
}
${
NET_LIBS
}
${
LIBM
}
@PCRE_LIBS@
if
ENABLE_TESTS
TESTS
=
num_c_test
TESTS
=
v
num_c_test
noinst_PROGRAMS
=
${
TESTS
}
num_c_test_SOURCES
=
num.c
num_c_test_CFLAGS
=
-DNUM_C_TEST
-include
config.h
num_c_test_LDADD
=
${
LIBM
}
vnum_c_test_SOURCES
=
v
num.c
v
num_c_test_CFLAGS
=
-DNUM_C_TEST
-include
config.h
v
num_c_test_LDADD
=
${
LIBM
}
test
:
${TESTS}
@
for
test
in
${
TESTS
}
;
do
./
$$
{
test
}
;
done
...
...
lib/libvarnish/num.c
→
lib/libvarnish/
v
num.c
View file @
368197ad
...
...
@@ -35,7 +35,7 @@
#include <stdlib.h>
#include <stdint.h>
#include "
libvarnish
.h"
#include "
vnum
.h"
static
const
char
err_miss_num
[]
=
"Missing number"
;
static
const
char
err_invalid_num
[]
=
"Invalid number"
;
...
...
@@ -43,7 +43,7 @@ static const char err_abs_req[] = "Absolute number required";
static
const
char
err_invalid_suff
[]
=
"Invalid suffix"
;
const
char
*
str
2bytes
(
const
char
*
p
,
uintmax_t
*
r
,
uintmax_t
rel
)
VNUM_
2bytes
(
const
char
*
p
,
uintmax_t
*
r
,
uintmax_t
rel
)
{
double
fval
;
char
*
end
;
...
...
@@ -178,13 +178,13 @@ main(int argc, char *argv[])
(
void
)
argc
;
for
(
ec
=
0
,
tc
=
test_cases
;
tc
->
str
;
++
tc
)
{
e
=
str
2bytes
(
tc
->
str
,
&
val
,
tc
->
rel
);
e
=
VNUM_
2bytes
(
tc
->
str
,
&
val
,
tc
->
rel
);
if
(
e
!=
tc
->
err
)
{
printf
(
"%s:
str
2bytes(
\"
%s
\"
, %ju) (%s) != (%s)
\n
"
,
printf
(
"%s:
VNUM_
2bytes(
\"
%s
\"
, %ju) (%s) != (%s)
\n
"
,
*
argv
,
tc
->
str
,
tc
->
rel
,
tc
->
err
,
e
);
++
ec
;
}
else
if
(
e
==
NULL
&&
val
!=
tc
->
val
)
{
printf
(
"%s:
str
2bytes(
\"
%s
\"
, %ju) %ju != %ju (%s)
\n
"
,
printf
(
"%s:
VNUM_
2bytes(
\"
%s
\"
, %ju) %ju != %ju (%s)
\n
"
,
*
argv
,
tc
->
str
,
tc
->
rel
,
val
,
tc
->
val
,
e
);
++
ec
;
}
...
...
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