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
3278fdc2
Unverified
Commit
3278fdc2
authored
Aug 17, 2018
by
Christian Brauner
Committed by
GitHub
Aug 17, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2540 from tcharding/checkatch-cmd
cmd: Fix up checkpatch warnings
parents
5246e140
55186593
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
lxc_init.c
src/lxc/cmd/lxc_init.c
+6
-8
lxc_monitord.c
src/lxc/cmd/lxc_monitord.c
+2
-2
lxc_user_nic.c
src/lxc/cmd/lxc_user_nic.c
+4
-3
No files found.
src/lxc/cmd/lxc_init.c
View file @
3278fdc2
...
...
@@ -47,7 +47,7 @@
/* option keys for long only options */
#define OPT_USAGE 0x1000
#define OPT_VERSION
OPT_USAGE - 1
#define OPT_VERSION
(OPT_USAGE - 1)
#define QUOTE(macro) #macro
#define QUOTEVAL(macro) QUOTE(macro)
...
...
@@ -73,7 +73,7 @@ static struct option long_options[] = {
{
"lxcpath"
,
required_argument
,
0
,
'P'
},
{
0
,
0
,
0
,
0
}
};
static
char
short_options
[]
=
"n:hqo:l:P:"
;
static
c
onst
c
har
short_options
[]
=
"n:hqo:l:P:"
;
struct
arguments
{
const
struct
option
*
options
;
...
...
@@ -468,18 +468,18 @@ out:
static
void
print_usage
(
const
struct
option
longopts
[])
{
fprintf
(
stderr
,
"Usage: lxc-init [-n|--name=NAME] [-h|--help] [--usage] [--version]
\n
\
fprintf
(
stderr
,
"Usage: lxc-init [-n|--name=NAME] [-h|--help] [--usage] [--version]
\n
\
[-q|--quiet] [-o|--logfile=LOGFILE] [-l|--logpriority=LOGPRIORITY] [-P|--lxcpath=LXCPATH]
\n
"
);
exit
(
0
);
}
static
void
print_version
()
static
void
print_version
(
void
)
{
printf
(
"%s
\n
"
,
LXC_VERSION
);
exit
(
0
);
}
static
void
print_help
()
static
void
print_help
(
void
)
{
fprintf
(
stderr
,
"\
Usage: lxc-init --name=NAME -- COMMAND
\n
\
...
...
@@ -500,7 +500,6 @@ Mandatory or optional arguments to long options are also mandatory or optional\n
for any corresponding short options.
\n
\
\n
\
See the lxc-init man page for further information.
\n\n
"
);
}
static
int
arguments_parse
(
struct
arguments
*
args
,
int
argc
,
...
...
@@ -550,9 +549,8 @@ static int arguments_parse(struct arguments *args, int argc,
args
->
argc
=
argc
-
optind
;
/* If no lxcpath was given, use default */
if
(
!
args
->
lxcpath
)
{
if
(
!
args
->
lxcpath
)
args
->
lxcpath
=
lxc_global_config_value
(
"lxc.lxcpath"
);
}
/* Check the command options */
if
(
!
args
->
name
)
{
...
...
src/lxc/cmd/lxc_monitord.c
View file @
3278fdc2
...
...
@@ -89,7 +89,7 @@ static int lxc_monitord_fifo_create(struct lxc_monitor *mon)
if
(
ret
<
0
)
return
ret
;
ret
=
mknod
(
fifo_path
,
S_IFIFO
|
S_IRUSR
|
S_IWUSR
,
0
);
ret
=
mknod
(
fifo_path
,
S_IFIFO
|
S_IRUSR
|
S_IWUSR
,
0
);
if
(
ret
<
0
&&
errno
!=
EEXIST
)
{
SYSINFO
(
"Failed to mknod monitor fifo %s"
,
fifo_path
);
return
-
1
;
...
...
@@ -208,7 +208,7 @@ static int lxc_monitord_sock_accept(int fd, uint32_t events, void *data,
clientfds
=
realloc
(
mon
->
clientfds
,
(
mon
->
clientfds_size
+
CLIENTFDS_CHUNK
)
*
sizeof
(
mon
->
clientfds
[
0
]));
if
(
clientfds
==
NULL
)
{
if
(
!
clientfds
)
{
ERROR
(
"Failed to realloc memory for %d client file descriptors"
,
mon
->
clientfds_size
+
CLIENTFDS_CHUNK
);
goto
err1
;
...
...
src/lxc/cmd/lxc_user_nic.c
View file @
3278fdc2
...
...
@@ -512,7 +512,8 @@ static int instantiate_veth(char *veth1, char *veth2)
/* Changing the high byte of the mac address to 0xfe, the bridge
* interface will always keep the host's mac address and not take the
* mac address of a container. */
* mac address of a container.
*/
ret
=
setup_private_host_hw_addr
(
veth1
);
if
(
ret
<
0
)
usernic_error
(
"Failed to change mac address of host interface "
...
...
@@ -686,7 +687,7 @@ static bool cull_entries(int fd, char *name, char *net_type, char *net_link,
static
int
count_entries
(
char
*
buf
,
off_t
len
,
char
*
name
,
char
*
net_type
,
char
*
net_link
)
{
int
count
=
0
;
bool
owner
=
false
;
;
bool
owner
=
false
;
char
*
buf_end
;
buf_end
=
&
buf
[
len
];
...
...
@@ -751,7 +752,7 @@ static char *get_nic_if_avail(int fd, struct alloted_s *names, int pid,
lxc_strmunmap
(
buf
,
sb
.
st_size
);
}
if
(
owner
==
NULL
)
if
(
!
owner
)
return
NULL
;
ret
=
snprintf
(
nicname
,
sizeof
(
nicname
),
"vethXXXXXX"
);
...
...
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