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
03fadd16
Unverified
Commit
03fadd16
authored
Feb 17, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some missing newlines
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
14a666b5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
15 deletions
+15
-15
cgmanager.c
src/lxc/cgmanager.c
+2
-2
conf.c
src/lxc/conf.c
+1
-1
lxc_user_nic.c
src/lxc/lxc_user_nic.c
+3
-3
lxccontainer.c
src/lxc/lxccontainer.c
+1
-1
lxclock.c
src/lxc/lxclock.c
+2
-2
concurrent.c
src/tests/concurrent.c
+1
-1
get_item.c
src/tests/get_item.c
+4
-4
list.c
src/tests/list.c
+1
-1
No files found.
src/lxc/cgmanager.c
View file @
03fadd16
...
@@ -61,7 +61,7 @@ static void lock_mutex(pthread_mutex_t *l)
...
@@ -61,7 +61,7 @@ static void lock_mutex(pthread_mutex_t *l)
int
ret
;
int
ret
;
if
((
ret
=
pthread_mutex_lock
(
l
))
!=
0
)
{
if
((
ret
=
pthread_mutex_lock
(
l
))
!=
0
)
{
fprintf
(
stderr
,
"pthread_mutex_lock returned:%d %s"
,
ret
,
strerror
(
ret
));
fprintf
(
stderr
,
"pthread_mutex_lock returned:%d %s
\n
"
,
ret
,
strerror
(
ret
));
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -71,7 +71,7 @@ static void unlock_mutex(pthread_mutex_t *l)
...
@@ -71,7 +71,7 @@ static void unlock_mutex(pthread_mutex_t *l)
int
ret
;
int
ret
;
if
((
ret
=
pthread_mutex_unlock
(
l
))
!=
0
)
{
if
((
ret
=
pthread_mutex_unlock
(
l
))
!=
0
)
{
fprintf
(
stderr
,
"pthread_mutex_unlock returned:%d %s"
,
ret
,
strerror
(
ret
));
fprintf
(
stderr
,
"pthread_mutex_unlock returned:%d %s
\n
"
,
ret
,
strerror
(
ret
));
exit
(
1
);
exit
(
1
);
}
}
}
}
...
...
src/lxc/conf.c
View file @
03fadd16
...
@@ -3132,7 +3132,7 @@ static int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf,
...
@@ -3132,7 +3132,7 @@ static int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf,
ret
=
snprintf
(
path
,
PATH_MAX
,
"/proc/%d/%cid_map"
,
pid
,
idtype
==
ID_TYPE_UID
?
'u'
:
'g'
);
ret
=
snprintf
(
path
,
PATH_MAX
,
"/proc/%d/%cid_map"
,
pid
,
idtype
==
ID_TYPE_UID
?
'u'
:
'g'
);
if
(
ret
<
0
||
ret
>=
PATH_MAX
)
{
if
(
ret
<
0
||
ret
>=
PATH_MAX
)
{
fprintf
(
stderr
,
"%s: path name too long"
,
__func__
);
fprintf
(
stderr
,
"%s: path name too long
\n
"
,
__func__
);
return
-
E2BIG
;
return
-
E2BIG
;
}
}
f
=
fopen
(
path
,
"w"
);
f
=
fopen
(
path
,
"w"
);
...
...
src/lxc/lxc_user_nic.c
View file @
03fadd16
...
@@ -219,7 +219,7 @@ static int instanciate_veth(char *n1, char **n2)
...
@@ -219,7 +219,7 @@ static int instanciate_veth(char *n1, char **n2)
* of a container */
* of a container */
err
=
setup_private_host_hw_addr
(
n1
);
err
=
setup_private_host_hw_addr
(
n1
);
if
(
err
)
{
if
(
err
)
{
fprintf
(
stderr
,
"failed to change mac address of host interface '%s' : %s"
,
fprintf
(
stderr
,
"failed to change mac address of host interface '%s' : %s
\n
"
,
n1
,
strerror
(
-
err
));
n1
,
strerror
(
-
err
));
}
}
...
@@ -307,7 +307,7 @@ static bool cull_entries(int fd, char *me, char *t, char *br)
...
@@ -307,7 +307,7 @@ static bool cull_entries(int fd, char *me, char *t, char *br)
nic
=
alloca
(
100
);
nic
=
alloca
(
100
);
if
(
fstat
(
fd
,
&
sb
)
<
0
)
{
if
(
fstat
(
fd
,
&
sb
)
<
0
)
{
fprintf
(
stderr
,
"Failed to fstat: %s"
,
strerror
(
errno
));
fprintf
(
stderr
,
"Failed to fstat: %s
\n
"
,
strerror
(
errno
));
return
false
;
return
false
;
}
}
len
=
sb
.
st_size
;
len
=
sb
.
st_size
;
...
@@ -387,7 +387,7 @@ static bool get_nic_if_avail(int fd, char *me, int pid, char *intype, char *br,
...
@@ -387,7 +387,7 @@ static bool get_nic_if_avail(int fd, char *me, int pid, char *intype, char *br,
return
false
;
return
false
;
if
(
fstat
(
fd
,
&
sb
)
<
0
)
{
if
(
fstat
(
fd
,
&
sb
)
<
0
)
{
fprintf
(
stderr
,
"Failed to fstat: %s"
,
strerror
(
errno
));
fprintf
(
stderr
,
"Failed to fstat: %s
\n
"
,
strerror
(
errno
));
return
false
;
return
false
;
}
}
len
=
sb
.
st_size
;
len
=
sb
.
st_size
;
...
...
src/lxc/lxccontainer.c
View file @
03fadd16
...
@@ -3283,7 +3283,7 @@ struct lxc_container *lxc_container_new(const char *name, const char *configpath
...
@@ -3283,7 +3283,7 @@ struct lxc_container *lxc_container_new(const char *name, const char *configpath
c
->
config_path
=
strdup
(
lxc_global_config_value
(
"lxc.lxcpath"
));
c
->
config_path
=
strdup
(
lxc_global_config_value
(
"lxc.lxcpath"
));
if
(
!
c
->
config_path
)
{
if
(
!
c
->
config_path
)
{
fprintf
(
stderr
,
"Out of memory"
);
fprintf
(
stderr
,
"Out of memory
\n
"
);
goto
err
;
goto
err
;
}
}
...
...
src/lxc/lxclock.c
View file @
03fadd16
...
@@ -76,7 +76,7 @@ static void lock_mutex(pthread_mutex_t *l)
...
@@ -76,7 +76,7 @@ static void lock_mutex(pthread_mutex_t *l)
int
ret
;
int
ret
;
if
((
ret
=
pthread_mutex_lock
(
l
))
!=
0
)
{
if
((
ret
=
pthread_mutex_lock
(
l
))
!=
0
)
{
fprintf
(
stderr
,
"pthread_mutex_lock returned:%d %s"
,
ret
,
strerror
(
ret
));
fprintf
(
stderr
,
"pthread_mutex_lock returned:%d %s
\n
"
,
ret
,
strerror
(
ret
));
dump_stacktrace
();
dump_stacktrace
();
exit
(
1
);
exit
(
1
);
}
}
...
@@ -87,7 +87,7 @@ static void unlock_mutex(pthread_mutex_t *l)
...
@@ -87,7 +87,7 @@ static void unlock_mutex(pthread_mutex_t *l)
int
ret
;
int
ret
;
if
((
ret
=
pthread_mutex_unlock
(
l
))
!=
0
)
{
if
((
ret
=
pthread_mutex_unlock
(
l
))
!=
0
)
{
fprintf
(
stderr
,
"pthread_mutex_unlock returned:%d %s"
,
ret
,
strerror
(
ret
));
fprintf
(
stderr
,
"pthread_mutex_unlock returned:%d %s
\n
"
,
ret
,
strerror
(
ret
));
dump_stacktrace
();
dump_stacktrace
();
exit
(
1
);
exit
(
1
);
}
}
...
...
src/tests/concurrent.c
View file @
03fadd16
...
@@ -224,7 +224,7 @@ int main(int argc, char *argv[]) {
...
@@ -224,7 +224,7 @@ int main(int argc, char *argv[]) {
}
}
}
}
if
(
args
[
j
].
return_code
)
{
if
(
args
[
j
].
return_code
)
{
fprintf
(
stderr
,
"thread returned error %d"
,
args
[
j
].
return_code
);
fprintf
(
stderr
,
"thread returned error %d
\n
"
,
args
[
j
].
return_code
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
...
...
src/tests/get_item.c
View file @
03fadd16
...
@@ -281,22 +281,22 @@ int main(int argc, char *argv[])
...
@@ -281,22 +281,22 @@ int main(int argc, char *argv[])
printf
(
"%d: get_config_item (cgroup.devices.devices.allow) returned %d %s
\n
"
,
__LINE__
,
ret
,
v3
);
printf
(
"%d: get_config_item (cgroup.devices.devices.allow) returned %d %s
\n
"
,
__LINE__
,
ret
,
v3
);
if
(
!
c
->
clear_config_item
(
c
,
"lxc.cgroup"
))
{
if
(
!
c
->
clear_config_item
(
c
,
"lxc.cgroup"
))
{
fprintf
(
stderr
,
"%d: failed clearing lxc.cgroup"
,
__LINE__
);
fprintf
(
stderr
,
"%d: failed clearing lxc.cgroup
\n
"
,
__LINE__
);
ret
=
1
;
ret
=
1
;
goto
out
;
goto
out
;
}
}
if
(
!
c
->
clear_config_item
(
c
,
"lxc.cap.drop"
))
{
if
(
!
c
->
clear_config_item
(
c
,
"lxc.cap.drop"
))
{
fprintf
(
stderr
,
"%d: failed clearing lxc.cap.drop"
,
__LINE__
);
fprintf
(
stderr
,
"%d: failed clearing lxc.cap.drop
\n
"
,
__LINE__
);
ret
=
1
;
ret
=
1
;
goto
out
;
goto
out
;
}
}
if
(
!
c
->
clear_config_item
(
c
,
"lxc.mount.entries"
))
{
if
(
!
c
->
clear_config_item
(
c
,
"lxc.mount.entries"
))
{
fprintf
(
stderr
,
"%d: failed clearing lxc.mount.entries"
,
__LINE__
);
fprintf
(
stderr
,
"%d: failed clearing lxc.mount.entries
\n
"
,
__LINE__
);
ret
=
1
;
ret
=
1
;
goto
out
;
goto
out
;
}
}
if
(
!
c
->
clear_config_item
(
c
,
"lxc.hook"
))
{
if
(
!
c
->
clear_config_item
(
c
,
"lxc.hook"
))
{
fprintf
(
stderr
,
"%d: failed clearing lxc.hook"
,
__LINE__
);
fprintf
(
stderr
,
"%d: failed clearing lxc.hook
\n
"
,
__LINE__
);
ret
=
1
;
ret
=
1
;
goto
out
;
goto
out
;
}
}
...
...
src/tests/list.c
View file @
03fadd16
...
@@ -68,7 +68,7 @@ static void test_list_func(const char *lxcpath, const char *type,
...
@@ -68,7 +68,7 @@ static void test_list_func(const char *lxcpath, const char *type,
struct
lxc_container
*
c
=
clist
[
i
];
struct
lxc_container
*
c
=
clist
[
i
];
printf
(
"%-10s Got container struct %s, name %s
\n
"
,
type
,
c
->
name
,
names
[
i
]);
printf
(
"%-10s Got container struct %s, name %s
\n
"
,
type
,
c
->
name
,
names
[
i
]);
if
(
strcmp
(
c
->
name
,
names
[
i
]))
if
(
strcmp
(
c
->
name
,
names
[
i
]))
fprintf
(
stderr
,
"ERROR: name mismatch!"
);
fprintf
(
stderr
,
"ERROR: name mismatch!
\n
"
);
free
(
names
[
i
]);
free
(
names
[
i
]);
lxc_container_put
(
c
);
lxc_container_put
(
c
);
}
}
...
...
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