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
2492b2e3
Unverified
Commit
2492b2e3
authored
Jul 05, 2017
by
Long Wang
Committed by
Stéphane Graber
Jul 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-init: move initialization of act to outside of the loop
Signed-off-by:
Long Wang
<
w@laoqinren.net
>
parent
f602f03d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
lxc_init.c
src/lxc/tools/lxc_init.c
+13
-14
No files found.
src/lxc/tools/lxc_init.c
View file @
2492b2e3
...
...
@@ -81,6 +81,7 @@ int main(int argc, char *argv[])
int
err
;
char
**
aargv
;
sigset_t
mask
,
omask
;
struct
sigaction
act
;
int
i
,
have_status
=
0
,
shutdown
=
0
;
int
opt
;
char
*
lxcpath
=
NULL
,
*
name
=
NULL
,
*
logpriority
=
NULL
;
...
...
@@ -138,9 +139,19 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
}
for
(
i
=
1
;
i
<
NSIG
;
i
++
)
{
struct
sigaction
act
;
if
(
sigfillset
(
&
act
.
sa_mask
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGILL
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGSEGV
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGBUS
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGSTOP
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGKILL
))
{
ERROR
(
"Failed to set signal"
);
exit
(
EXIT_FAILURE
);
}
act
.
sa_flags
=
0
;
act
.
sa_handler
=
interrupt_handler
;
for
(
i
=
1
;
i
<
NSIG
;
i
++
)
{
/* Exclude some signals: ILL, SEGV and BUS are likely to
* reveal a bug and we want a core. STOP and KILL cannot be
* handled anyway: they're here for documentation. 32 and 33
...
...
@@ -154,18 +165,6 @@ int main(int argc, char *argv[])
i
==
32
||
i
==
33
)
continue
;
if
(
sigfillset
(
&
act
.
sa_mask
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGILL
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGSEGV
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGBUS
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGSTOP
)
||
sigdelset
(
&
act
.
sa_mask
,
SIGKILL
))
{
ERROR
(
"Failed to set signal"
);
exit
(
EXIT_FAILURE
);
}
act
.
sa_flags
=
0
;
act
.
sa_handler
=
interrupt_handler
;
if
(
sigaction
(
i
,
&
act
,
NULL
)
&&
errno
!=
EINVAL
)
{
SYSERROR
(
"Failed to sigaction"
);
exit
(
EXIT_FAILURE
);
...
...
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