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
e6a19d26
Commit
e6a19d26
authored
Apr 15, 2013
by
Dwight Engen
Committed by
Stéphane Graber
Apr 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fortify: minor cleanups for unused variables, stricter types
Signed-off-by:
Dwight Engen
<
dwight.engen@oracle.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
0a218854
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
8 deletions
+7
-8
log.c
src/lxc/log.c
+0
-1
log.h
src/lxc/log.h
+1
-1
lxccontainer.c
src/lxc/lxccontainer.c
+2
-2
network.c
src/lxc/network.c
+0
-1
state.c
src/lxc/state.c
+4
-3
No files found.
src/lxc/log.c
View file @
e6a19d26
...
@@ -244,7 +244,6 @@ extern int lxc_log_init(const char *name, const char *file,
...
@@ -244,7 +244,6 @@ extern int lxc_log_init(const char *name, const char *file,
lxc_log_setprefix
(
prefix
);
lxc_log_setprefix
(
prefix
);
if
(
file
&&
strcmp
(
file
,
"none"
)
==
0
)
{
if
(
file
&&
strcmp
(
file
,
"none"
)
==
0
)
{
want_lxc_log_specified
=
1
;
return
0
;
return
0
;
}
}
...
...
src/lxc/log.h
View file @
e6a19d26
...
@@ -172,7 +172,7 @@ __lxc_log(const struct lxc_log_category* category,
...
@@ -172,7 +172,7 @@ __lxc_log(const struct lxc_log_category* category,
}
}
/*
/*
* Helper macro to define log f
o
nctions.
* Helper macro to define log f
u
nctions.
*/
*/
#define lxc_log_priority_define(acategory, PRIORITY) \
#define lxc_log_priority_define(acategory, PRIORITY) \
\
\
...
...
src/lxc/lxccontainer.c
View file @
e6a19d26
...
@@ -630,7 +630,7 @@ static bool lxcapi_create(struct lxc_container *c, char *t, char *const argv[])
...
@@ -630,7 +630,7 @@ static bool lxcapi_create(struct lxc_container *c, char *t, char *const argv[])
newargv
[
nargs
-
1
]
=
NULL
;
newargv
[
nargs
-
1
]
=
NULL
;
/* execute */
/* execute */
ret
=
execv
(
tpath
,
newargv
);
execv
(
tpath
,
newargv
);
SYSERROR
(
"failed to execute template %s"
,
tpath
);
SYSERROR
(
"failed to execute template %s"
,
tpath
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -833,7 +833,7 @@ static bool lxcapi_destroy(struct lxc_container *c)
...
@@ -833,7 +833,7 @@ static bool lxcapi_destroy(struct lxc_container *c)
if
(
pid
<
0
)
if
(
pid
<
0
)
return
false
;
return
false
;
if
(
pid
==
0
)
{
// child
if
(
pid
==
0
)
{
// child
ret
=
execlp
(
"lxc-destroy"
,
"lxc-destroy"
,
"-n"
,
c
->
name
,
"-P"
,
c
->
config_path
,
NULL
);
execlp
(
"lxc-destroy"
,
"lxc-destroy"
,
"-n"
,
c
->
name
,
"-P"
,
c
->
config_path
,
NULL
);
perror
(
"execl"
);
perror
(
"execl"
);
exit
(
1
);
exit
(
1
);
}
}
...
...
src/lxc/network.c
View file @
e6a19d26
...
@@ -836,7 +836,6 @@ static int ip_addr_get(int family, int ifindex, void **res)
...
@@ -836,7 +836,6 @@ static int ip_addr_get(int family, int ifindex, void **res)
err
=
netlink_send
(
&
nlh
,
nlmsg
);
err
=
netlink_send
(
&
nlh
,
nlmsg
);
if
(
err
<
0
)
if
(
err
<
0
)
goto
out
;
goto
out
;
err
=
0
;
do
{
do
{
/* Restore the answer buffer length, it might have been
/* Restore the answer buffer length, it might have been
...
...
src/lxc/state.c
View file @
e6a19d26
...
@@ -56,7 +56,8 @@ const char *lxc_state2str(lxc_state_t state)
...
@@ -56,7 +56,8 @@ const char *lxc_state2str(lxc_state_t state)
lxc_state_t
lxc_str2state
(
const
char
*
state
)
lxc_state_t
lxc_str2state
(
const
char
*
state
)
{
{
int
i
,
len
;
size_t
len
;
lxc_state_t
i
;
len
=
sizeof
(
strstate
)
/
sizeof
(
strstate
[
0
]);
len
=
sizeof
(
strstate
)
/
sizeof
(
strstate
[
0
]);
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
!
strcmp
(
strstate
[
i
],
state
))
if
(
!
strcmp
(
strstate
[
i
],
state
))
...
@@ -66,7 +67,7 @@ lxc_state_t lxc_str2state(const char *state)
...
@@ -66,7 +67,7 @@ lxc_state_t lxc_str2state(const char *state)
return
-
1
;
return
-
1
;
}
}
static
in
t
freezer_state
(
const
char
*
name
,
const
char
*
lxcpath
)
static
lxc_state_
t
freezer_state
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
char
*
nsgroup
;
char
*
nsgroup
;
char
freezer
[
MAXPATHLEN
];
char
freezer
[
MAXPATHLEN
];
...
@@ -132,7 +133,7 @@ static lxc_state_t __lxc_getstate(const char *name, const char *lxcpath)
...
@@ -132,7 +133,7 @@ static lxc_state_t __lxc_getstate(const char *name, const char *lxcpath)
lxc_state_t
lxc_getstate
(
const
char
*
name
,
const
char
*
lxcpath
)
lxc_state_t
lxc_getstate
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
in
t
state
=
freezer_state
(
name
,
lxcpath
);
lxc_state_
t
state
=
freezer_state
(
name
,
lxcpath
);
if
(
state
!=
FROZEN
&&
state
!=
FREEZING
)
if
(
state
!=
FROZEN
&&
state
!=
FREEZING
)
state
=
__lxc_getstate
(
name
,
lxcpath
);
state
=
__lxc_getstate
(
name
,
lxcpath
);
return
state
;
return
state
;
...
...
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