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
f111a899
Commit
f111a899
authored
Aug 10, 2017
by
Stéphane Graber
Committed by
GitHub
Aug 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1736 from brauner/2017-08-08/fix_gcc_warnings
cgfsng: do not use uninitialized variable
parents
28cfa8fc
462a15ef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
cgfsng.c
src/lxc/cgroups/cgfsng.c
+6
-4
lxccontainer.c
src/lxc/lxccontainer.c
+0
-12
No files found.
src/lxc/cgroups/cgfsng.c
View file @
f111a899
...
@@ -1904,10 +1904,12 @@ static int cgfsng_set(const char *filename, const char *value, const char *name,
...
@@ -1904,10 +1904,12 @@ static int cgfsng_set(const char *filename, const char *value, const char *name,
*/
*/
static
int
convert_devpath
(
const
char
*
invalue
,
char
*
dest
)
static
int
convert_devpath
(
const
char
*
invalue
,
char
*
dest
)
{
{
char
*
p
,
*
path
,
*
mode
,
type
;
int
n_parts
;
char
*
p
,
*
path
,
type
;
struct
stat
sb
;
struct
stat
sb
;
unsigned
long
minor
,
major
;
unsigned
long
minor
,
major
;
int
n_parts
,
ret
=
-
EINVAL
;
int
ret
=
-
EINVAL
;
char
*
mode
=
NULL
;
path
=
must_copy_string
(
invalue
);
path
=
must_copy_string
(
invalue
);
...
@@ -1956,8 +1958,8 @@ static int convert_devpath(const char *invalue, char *dest)
...
@@ -1956,8 +1958,8 @@ static int convert_devpath(const char *invalue, char *dest)
minor
=
MINOR
(
sb
.
st_rdev
);
minor
=
MINOR
(
sb
.
st_rdev
);
ret
=
snprintf
(
dest
,
50
,
"%c %lu:%lu %s"
,
type
,
major
,
minor
,
mode
);
ret
=
snprintf
(
dest
,
50
,
"%c %lu:%lu %s"
,
type
,
major
,
minor
,
mode
);
if
(
ret
<
0
||
ret
>=
50
)
{
if
(
ret
<
0
||
ret
>=
50
)
{
ERROR
(
"Error on configuration value
\"
%c %lu:%lu %s
\"
(max 50
chars)"
,
ERROR
(
"Error on configuration value
\"
%c %lu:%lu %s
\"
(max 50
"
type
,
major
,
minor
,
mode
);
"chars)"
,
type
,
major
,
minor
,
mode
);
ret
=
-
ENAMETOOLONG
;
ret
=
-
ENAMETOOLONG
;
goto
out
;
goto
out
;
}
}
...
...
src/lxc/lxccontainer.c
View file @
f111a899
...
@@ -705,18 +705,6 @@ static int lxc_rcv_status(int state_socket)
...
@@ -705,18 +705,6 @@ static int lxc_rcv_status(int state_socket)
{
{
int
ret
;
int
ret
;
int
state
=
-
1
;
int
state
=
-
1
;
struct
timeval
timeout
=
{
0
};
/* Set 5 second timeout to prevent hanging forever in case something
* goes wrong. 5 seconds is a long time to get into RUNNING state.
*/
timeout
.
tv_sec
=
5
;
ret
=
setsockopt
(
state_socket
,
SOL_SOCKET
,
SO_RCVTIMEO
,
(
const
void
*
)
&
timeout
,
sizeof
(
timeout
));
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to set 5s timeout on containter state socket"
);
return
-
1
;
}
again
:
again
:
/* Receive container state. */
/* Receive container 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