Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
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
zhul
criu
Commits
0327d551
Commit
0327d551
authored
Sep 28, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fdset: Beautify fdset opening
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
02227d87
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
image.c
image.c
+3
-3
crtools.h
include/crtools.h
+3
-1
ipc_ns.c
ipc_ns.c
+1
-1
namespaces.c
namespaces.c
+2
-4
net.c
net.c
+1
-1
No files found.
image.c
View file @
0327d551
...
...
@@ -147,7 +147,7 @@ void close_cr_fdset(struct cr_fdset **cr_fdset)
*
cr_fdset
=
NULL
;
}
struct
cr_fdset
*
cr_fdset_open
(
int
pid
,
int
from
,
int
to
,
struct
cr_fdset
*
cr_fdset_open
_range
(
int
pid
,
int
from
,
int
to
,
unsigned
long
flags
)
{
struct
cr_fdset
*
fdset
;
...
...
@@ -181,12 +181,12 @@ err:
struct
cr_fdset
*
cr_task_fdset_open
(
int
pid
,
int
mode
)
{
return
cr_fdset_open
(
pid
,
_CR_FD_TASK_FROM
,
_CR_FD_TASK_TO
,
mode
);
return
cr_fdset_open
(
pid
,
TASK
,
mode
);
}
struct
cr_fdset
*
cr_glob_fdset_open
(
int
mode
)
{
return
cr_fdset_open
(
-
1
/* ignored */
,
_CR_FD_GLOB_FROM
,
_CR_FD_GLOB_TO
,
mode
);
return
cr_fdset_open
(
-
1
/* ignored */
,
GLOB
,
mode
);
}
int
open_image_at
(
int
dfd
,
int
type
,
unsigned
long
flags
,
...)
...
...
include/crtools.h
View file @
0327d551
...
...
@@ -124,8 +124,10 @@ int cr_exec(int pid, char **opts);
#define O_RSTR (O_RDONLY)
struct
cr_fdset
*
cr_task_fdset_open
(
int
pid
,
int
mode
);
struct
cr_fdset
*
cr_fdset_open
(
int
pid
,
int
from
,
int
to
,
struct
cr_fdset
*
cr_fdset_open
_range
(
int
pid
,
int
from
,
int
to
,
unsigned
long
flags
);
#define cr_fdset_open(pid, type, flags) cr_fdset_open_range(pid, \
_CR_FD_##type##_FROM, _CR_FD_##type##_TO, flags)
struct
cr_fdset
*
cr_glob_fdset_open
(
int
mode
);
void
close_cr_fdset
(
struct
cr_fdset
**
cr_fdset
);
...
...
ipc_ns.c
View file @
0327d551
...
...
@@ -460,7 +460,7 @@ int dump_ipc_ns(int ns_pid, int ns_id)
int
ret
;
struct
cr_fdset
*
fdset
;
fdset
=
cr_fdset_open
(
ns_id
,
_CR_FD_IPCNS_FROM
,
_CR_FD_IPCNS_TO
,
O_DUMP
);
fdset
=
cr_fdset_open
(
ns_id
,
IPCNS
,
O_DUMP
);
if
(
fdset
==
NULL
)
return
-
1
;
...
...
namespaces.c
View file @
0327d551
...
...
@@ -495,8 +495,7 @@ int try_show_namespaces(int ns_pid)
if
(
ret
<
0
)
return
-
1
;
fdset
=
cr_fdset_open
(
ids
->
net_ns_id
,
_CR_FD_NETNS_FROM
,
_CR_FD_NETNS_TO
,
O_SHOW
);
fdset
=
cr_fdset_open
(
ids
->
net_ns_id
,
NETNS
,
O_SHOW
);
if
(
fdset
)
{
pr_msg
(
"-------------------NETNS---------------------
\n
"
);
for
(
i
=
_CR_FD_NETNS_FROM
+
1
;
i
<
_CR_FD_NETNS_TO
;
i
++
)
{
...
...
@@ -511,8 +510,7 @@ int try_show_namespaces(int ns_pid)
close_cr_fdset
(
&
fdset
);
}
fdset
=
cr_fdset_open
(
ids
->
ipc_ns_id
,
_CR_FD_IPCNS_FROM
,
_CR_FD_IPCNS_TO
,
O_SHOW
);
fdset
=
cr_fdset_open
(
ids
->
ipc_ns_id
,
IPCNS
,
O_SHOW
);
if
(
fdset
)
{
pr_msg
(
"-------------------IPCNS---------------------
\n
"
);
for
(
i
=
_CR_FD_IPCNS_FROM
+
1
;
i
<
_CR_FD_IPCNS_TO
;
i
++
)
{
...
...
net.c
View file @
0327d551
...
...
@@ -468,7 +468,7 @@ int dump_net_ns(int pid, int ns_id)
struct
cr_fdset
*
fds
;
int
ret
;
fds
=
cr_fdset_open
(
ns_id
,
_CR_FD_NETNS_FROM
,
_CR_FD_NETNS_TO
,
O_DUMP
);
fds
=
cr_fdset_open
(
ns_id
,
NETNS
,
O_DUMP
);
if
(
fds
==
NULL
)
return
-
1
;
...
...
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