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
f4072342
Commit
f4072342
authored
May 18, 2009
by
Michel Normand
Committed by
Daniel Lezcano
May 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct error reporting for lxc_setstate
there was a missing init of local variable Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
Signed-off-by:
Michel Normand
<
normand@fr.ibm.com
>
parent
79507e49
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
state.c
src/lxc/state.c
+4
-4
No files found.
src/lxc/state.c
View file @
f4072342
...
@@ -62,19 +62,19 @@ lxc_state_t lxc_str2state(const char *state)
...
@@ -62,19 +62,19 @@ lxc_state_t lxc_str2state(const char *state)
int
lxc_setstate
(
const
char
*
name
,
lxc_state_t
state
)
int
lxc_setstate
(
const
char
*
name
,
lxc_state_t
state
)
{
{
int
fd
,
err
;
int
fd
,
err
=
-
1
;
char
file
[
MAXPATHLEN
];
char
file
[
MAXPATHLEN
];
const
char
*
str
=
lxc_state2str
(
state
);
const
char
*
str
=
lxc_state2str
(
state
);
if
(
!
str
)
if
(
!
str
)
return
-
1
;
return
err
;
snprintf
(
file
,
MAXPATHLEN
,
LXCPATH
"/%s/state"
,
name
);
snprintf
(
file
,
MAXPATHLEN
,
LXCPATH
"/%s/state"
,
name
);
fd
=
open
(
file
,
O_WRONLY
);
fd
=
open
(
file
,
O_WRONLY
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
SYSERROR
(
"failed to open %s file"
,
file
);
SYSERROR
(
"failed to open %s file"
,
file
);
return
-
1
;
return
err
;
}
}
if
(
flock
(
fd
,
LOCK_EX
))
{
if
(
flock
(
fd
,
LOCK_EX
))
{
...
@@ -98,7 +98,7 @@ out:
...
@@ -98,7 +98,7 @@ out:
lxc_monitor_send_state
(
name
,
state
);
lxc_monitor_send_state
(
name
,
state
);
return
-
err
;
return
err
;
}
}
int
lxc_mkstate
(
const
char
*
name
)
int
lxc_mkstate
(
const
char
*
name
)
...
...
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