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
e2a0258d
Commit
e2a0258d
authored
Aug 11, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: Use open_detahc_mount helper for proc service fd creation
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
cdce5d21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
cr-restore.c
cr-restore.c
+7
-13
No files found.
cr-restore.c
View file @
e2a0258d
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "image.h"
#include "image.h"
#include "util.h"
#include "util.h"
#include "util-pie.h"
#include "log.h"
#include "log.h"
#include "syscall.h"
#include "syscall.h"
#include "restorer.h"
#include "restorer.h"
...
@@ -1053,7 +1054,7 @@ static void restore_pgid(void)
...
@@ -1053,7 +1054,7 @@ static void restore_pgid(void)
static
int
mount_proc
(
void
)
static
int
mount_proc
(
void
)
{
{
int
ret
;
int
fd
,
ret
;
char
proc_mountpoint
[]
=
"crtools-proc.XXXXXX"
;
char
proc_mountpoint
[]
=
"crtools-proc.XXXXXX"
;
if
(
mkdtemp
(
proc_mountpoint
)
==
NULL
)
{
if
(
mkdtemp
(
proc_mountpoint
)
==
NULL
)
{
...
@@ -1064,21 +1065,14 @@ static int mount_proc(void)
...
@@ -1064,21 +1065,14 @@ static int mount_proc(void)
pr_info
(
"Mount procfs in %s
\n
"
,
proc_mountpoint
);
pr_info
(
"Mount procfs in %s
\n
"
,
proc_mountpoint
);
if
(
mount
(
"proc"
,
proc_mountpoint
,
"proc"
,
MS_MGC_VAL
,
NULL
))
{
if
(
mount
(
"proc"
,
proc_mountpoint
,
"proc"
,
MS_MGC_VAL
,
NULL
))
{
pr_perror
(
"mount failed"
);
pr_perror
(
"mount failed"
);
ret
=
-
1
;
rmdir
(
proc_mountpoint
);
goto
out_rmdir
;
}
ret
=
set_proc_mountpoint
(
proc_mountpoint
);
if
(
umount2
(
proc_mountpoint
,
MNT_DETACH
)
==
-
1
)
{
pr_perror
(
"Can't umount %s"
,
proc_mountpoint
);
return
-
1
;
return
-
1
;
}
}
out_rmdir:
ret
=
fd
=
open_detach_mount
(
proc_mountpoint
);
if
(
rmdir
(
proc_mountpoint
)
==
-
1
)
{
if
(
fd
>=
0
)
{
pr_perror
(
"Can't remove %s"
,
proc_mountpoint
);
ret
=
set_proc_fd
(
fd
);
return
-
1
;
close
(
fd
)
;
}
}
return
ret
;
return
ret
;
...
...
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