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
69b8cac2
Commit
69b8cac2
authored
May 20, 2016
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: Rename move_img_fd
Signed-off-by:
Pavel Emelyanov
<
xemul@virtuozzo.com
>
parent
09cee18a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
files.c
criu/files.c
+1
-1
util.h
criu/include/util.h
+1
-1
mount.c
criu/mount.c
+1
-1
util.c
criu/util.c
+4
-4
No files found.
criu/files.c
View file @
69b8cac2
...
...
@@ -887,7 +887,7 @@ static int send_fd_to_self(int fd, struct fdinfo_list_entry *fle, int *sock)
return
-
1
;
pr_info
(
"
\t\t\t
Going to dup %d into %d
\n
"
,
fd
,
dfd
);
if
(
move_
img_fd
(
sock
,
dfd
))
if
(
move_
fd_from
(
sock
,
dfd
))
return
-
1
;
if
(
dup2
(
fd
,
dfd
)
!=
dfd
)
{
...
...
criu/include/util.h
View file @
69b8cac2
...
...
@@ -50,7 +50,7 @@ extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area);
} while (0)
#define pr_info_vma_list(head) pr_vma_list(LOG_INFO, head)
extern
int
move_
img_fd
(
int
*
img_fd
,
int
want_fd
);
extern
int
move_
fd_from
(
int
*
img_fd
,
int
want_fd
);
extern
int
close_safe
(
int
*
fd
);
extern
int
reopen_fd_as_safe
(
char
*
file
,
int
line
,
int
new_fd
,
int
old_fd
,
bool
allow_reuse_fd
);
...
...
criu/mount.c
View file @
69b8cac2
...
...
@@ -1267,7 +1267,7 @@ static int tmpfs_dump(struct mount_info *pm)
* non-zero, because cr_system_userns closes STDIN_FILENO as we are not
* interested in passing stdin to tar.
*/
if
(
move_
img_fd
(
&
fd
,
STDIN_FILENO
)
<
0
)
if
(
move_
fd_from
(
&
fd
,
STDIN_FILENO
)
<
0
)
goto
out
;
if
(
fcntl
(
fd
,
F_SETFD
,
fcntl
(
fd
,
F_GETFD
)
&
~
FD_CLOEXEC
)
==
-
1
)
{
...
...
criu/util.c
View file @
69b8cac2
...
...
@@ -218,7 +218,7 @@ int reopen_fd_as_safe(char *file, int line, int new_fd, int old_fd, bool allow_r
return
0
;
}
int
move_
img_fd
(
int
*
img_fd
,
int
want_fd
)
int
move_
fd_from
(
int
*
img_fd
,
int
want_fd
)
{
if
(
*
img_fd
==
want_fd
)
{
int
tmp
;
...
...
@@ -621,8 +621,8 @@ int cr_system_userns(int in, int out, int err, char *cmd,
if
(
out
==
in
)
out
=
DUP_SAFE
(
out
,
out_chld
);
if
(
move_
img_fd
(
&
out
,
STDIN_FILENO
)
||
move_
img_fd
(
&
err
,
STDIN_FILENO
))
if
(
move_
fd_from
(
&
out
,
STDIN_FILENO
)
||
move_
fd_from
(
&
err
,
STDIN_FILENO
))
goto
out_chld
;
if
(
in
<
0
)
{
...
...
@@ -632,7 +632,7 @@ int cr_system_userns(int in, int out, int err, char *cmd,
goto
out_chld
;
}
if
(
move_
img_fd
(
&
err
,
STDOUT_FILENO
))
if
(
move_
fd_from
(
&
err
,
STDOUT_FILENO
))
goto
out_chld
;
if
(
reopen_fd_as_nocheck
(
STDOUT_FILENO
,
out
))
...
...
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