Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
f7662514
Unverified
Commit
f7662514
authored
Mar 04, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: make parse_limit_value() static
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
5648fc19
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
confile.c
src/lxc/confile.c
+20
-0
confile_utils.c
src/lxc/confile_utils.c
+1
-20
confile_utils.h
src/lxc/confile_utils.h
+0
-1
No files found.
src/lxc/confile.c
View file @
f7662514
...
@@ -1450,6 +1450,26 @@ static int set_config_cgroup_relative(const char *key, const char *value,
...
@@ -1450,6 +1450,26 @@ static int set_config_cgroup_relative(const char *key, const char *value,
return
-
EINVAL
;
return
-
EINVAL
;
}
}
static
bool
parse_limit_value
(
const
char
**
value
,
rlim_t
*
res
)
{
char
*
endptr
=
NULL
;
if
(
strncmp
(
*
value
,
"unlimited"
,
STRLITERALLEN
(
"unlimited"
))
==
0
)
{
*
res
=
RLIM_INFINITY
;
*
value
+=
STRLITERALLEN
(
"unlimited"
);
return
true
;
}
errno
=
0
;
*
res
=
strtoull
(
*
value
,
&
endptr
,
10
);
if
(
errno
||
!
endptr
)
return
false
;
*
value
=
endptr
;
return
true
;
}
static
int
set_config_prlimit
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_prlimit
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
...
...
src/lxc/confile_utils.c
View file @
f7662514
...
@@ -669,6 +669,7 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
...
@@ -669,6 +669,7 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
return
fulllen
;
return
fulllen
;
}
}
int
lxc_get_conf_size_t
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
size_t
v
)
int
lxc_get_conf_size_t
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
size_t
v
)
{
{
int
len
;
int
len
;
...
@@ -699,26 +700,6 @@ int lxc_get_conf_uint64(struct lxc_conf *c, char *retv, int inlen, uint64_t v)
...
@@ -699,26 +700,6 @@ int lxc_get_conf_uint64(struct lxc_conf *c, char *retv, int inlen, uint64_t v)
return
fulllen
;
return
fulllen
;
}
}
bool
parse_limit_value
(
const
char
**
value
,
rlim_t
*
res
)
{
char
*
endptr
=
NULL
;
if
(
strncmp
(
*
value
,
"unlimited"
,
STRLITERALLEN
(
"unlimited"
))
==
0
)
{
*
res
=
RLIM_INFINITY
;
*
value
+=
STRLITERALLEN
(
"unlimited"
);
return
true
;
}
errno
=
0
;
*
res
=
strtoull
(
*
value
,
&
endptr
,
10
);
if
(
errno
||
!
endptr
)
return
false
;
*
value
=
endptr
;
return
true
;
}
static
int
lxc_container_name_to_pid
(
const
char
*
lxcname_or_pid
,
static
int
lxc_container_name_to_pid
(
const
char
*
lxcname_or_pid
,
const
char
*
lxcpath
)
const
char
*
lxcpath
)
{
{
...
...
src/lxc/confile_utils.h
View file @
f7662514
...
@@ -73,7 +73,6 @@ extern int lxc_get_conf_bool(struct lxc_conf *c, char *retv, int inlen, bool v);
...
@@ -73,7 +73,6 @@ extern int lxc_get_conf_bool(struct lxc_conf *c, char *retv, int inlen, bool v);
extern
int
lxc_get_conf_int
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
int
v
);
extern
int
lxc_get_conf_int
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
int
v
);
extern
int
lxc_get_conf_size_t
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
size_t
v
);
extern
int
lxc_get_conf_size_t
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
size_t
v
);
extern
int
lxc_get_conf_uint64
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
uint64_t
v
);
extern
int
lxc_get_conf_uint64
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
uint64_t
v
);
extern
bool
parse_limit_value
(
const
char
**
value
,
rlim_t
*
res
);
extern
int
lxc_inherit_namespace
(
const
char
*
lxcname_or_pid
,
extern
int
lxc_inherit_namespace
(
const
char
*
lxcname_or_pid
,
const
char
*
lxcpath
,
const
char
*
namespace
);
const
char
*
lxcpath
,
const
char
*
namespace
);
extern
int
sig_parse
(
const
char
*
signame
);
extern
int
sig_parse
(
const
char
*
signame
);
...
...
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