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
5dec9c3e
Commit
5dec9c3e
authored
Jul 01, 2018
by
2xsec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: lxc-copy: remove the trailing . & fix coding style of strncmp
Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
dc71fcca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
lxc_copy.c
src/lxc/tools/lxc_copy.c
+8
-8
No files found.
src/lxc/tools/lxc_copy.c
View file @
5dec9c3e
...
@@ -187,7 +187,7 @@ int main(int argc, char *argv[])
...
@@ -187,7 +187,7 @@ int main(int argc, char *argv[])
}
}
if
(
!
my_args
.
newname
&&
!
(
my_args
.
task
==
DESTROY
))
{
if
(
!
my_args
.
newname
&&
!
(
my_args
.
task
==
DESTROY
))
{
ERROR
(
"You must provide a NEWNAME for the clone
.
"
);
ERROR
(
"You must provide a NEWNAME for the clone"
);
exit
(
ret
);
exit
(
ret
);
}
}
...
@@ -603,7 +603,7 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
...
@@ -603,7 +603,7 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
return
-
1
;
return
-
1
;
break
;
break
;
case
'B'
:
case
'B'
:
if
(
!
strncmp
(
arg
,
"overlay"
,
strlen
(
arg
))
)
if
(
strncmp
(
arg
,
"overlay"
,
strlen
(
arg
))
==
0
)
arg
=
"overlayfs"
;
arg
=
"overlayfs"
;
args
->
bdevtype
=
arg
;
args
->
bdevtype
=
arg
;
break
;
break
;
...
@@ -649,10 +649,10 @@ static int parse_bind_mnt(char *mntstring, enum mnttype type)
...
@@ -649,10 +649,10 @@ static int parse_bind_mnt(char *mntstring, enum mnttype type)
if
(
len
==
1
)
{
/* bind=src */
if
(
len
==
1
)
{
/* bind=src */
m
->
dest
=
construct_path
(
mntarray
[
0
],
false
);
m
->
dest
=
construct_path
(
mntarray
[
0
],
false
);
}
else
if
(
len
==
2
)
{
/* bind=src:option or bind=src:dest */
}
else
if
(
len
==
2
)
{
/* bind=src:option or bind=src:dest */
if
(
!
strncmp
(
mntarray
[
1
],
"rw"
,
strlen
(
mntarray
[
1
]))
)
if
(
strncmp
(
mntarray
[
1
],
"rw"
,
strlen
(
mntarray
[
1
]))
==
0
)
m
->
options
=
strdup
(
"rw"
);
m
->
options
=
strdup
(
"rw"
);
if
(
!
strncmp
(
mntarray
[
1
],
"ro"
,
strlen
(
mntarray
[
1
]))
)
if
(
strncmp
(
mntarray
[
1
],
"ro"
,
strlen
(
mntarray
[
1
]))
==
0
)
m
->
options
=
strdup
(
"ro"
);
m
->
options
=
strdup
(
"ro"
);
if
(
m
->
options
)
if
(
m
->
options
)
...
@@ -672,8 +672,8 @@ static int parse_bind_mnt(char *mntstring, enum mnttype type)
...
@@ -672,8 +672,8 @@ static int parse_bind_mnt(char *mntstring, enum mnttype type)
if
(
!
m
->
options
)
if
(
!
m
->
options
)
m
->
options
=
strdup
(
"rw"
);
m
->
options
=
strdup
(
"rw"
);
if
(
!
m
->
options
||
(
strncmp
(
m
->
options
,
"rw"
,
strlen
(
m
->
options
))
&&
if
(
!
m
->
options
||
(
strncmp
(
m
->
options
,
"rw"
,
strlen
(
m
->
options
))
!=
0
&&
strncmp
(
m
->
options
,
"ro"
,
strlen
(
m
->
options
))))
strncmp
(
m
->
options
,
"ro"
,
strlen
(
m
->
options
))
!=
0
))
goto
err
;
goto
err
;
lxc_free_array
((
void
**
)
mntarray
,
free
);
lxc_free_array
((
void
**
)
mntarray
,
free
);
...
@@ -771,7 +771,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
...
@@ -771,7 +771,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
if
(
arg
->
tmpfs
&&
!
arg
->
bdevtype
)
{
if
(
arg
->
tmpfs
&&
!
arg
->
bdevtype
)
{
arg
->
bdevtype
=
"overlayfs"
;
arg
->
bdevtype
=
"overlayfs"
;
}
else
if
(
arg
->
tmpfs
&&
arg
->
bdevtype
&&
}
else
if
(
arg
->
tmpfs
&&
arg
->
bdevtype
&&
strncmp
(
arg
->
bdevtype
,
"overlayfs"
,
strlen
(
arg
->
bdevtype
)))
{
strncmp
(
arg
->
bdevtype
,
"overlayfs"
,
strlen
(
arg
->
bdevtype
))
!=
0
)
{
ERROR
(
"%s"
,
ERROR
(
"%s"
,
"A container can only be placed on a tmpfs when the "
"A container can only be placed on a tmpfs when the "
"overlay storage driver is used"
);
"overlay storage driver is used"
);
...
@@ -794,7 +794,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
...
@@ -794,7 +794,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
goto
err_free
;
goto
err_free
;
if
(
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
))
{
if
(
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
))
{
ERROR
(
"Failed to set close-on-exec on file descriptor
.
"
);
ERROR
(
"Failed to set close-on-exec on file descriptor"
);
goto
err_close
;
goto
err_close
;
}
}
...
...
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