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
6c83c242
Commit
6c83c242
authored
Mar 15, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shmem: Simplify error paths
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
94c6d773
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
shmem.c
shmem.c
+5
-13
No files found.
shmem.c
View file @
6c83c242
...
@@ -294,7 +294,7 @@ int add_shmem_area(pid_t pid, VmaEntry *vma)
...
@@ -294,7 +294,7 @@ int add_shmem_area(pid_t pid, VmaEntry *vma)
static
int
dump_one_shmem
(
struct
shmem_info_dump
*
si
)
static
int
dump_one_shmem
(
struct
shmem_info_dump
*
si
)
{
{
PagemapEntry
pe
=
PAGEMAP_ENTRY__INIT
;
PagemapEntry
pe
=
PAGEMAP_ENTRY__INIT
;
int
err
,
fd
,
fd_pg
;
int
err
,
fd
,
fd_pg
,
ret
=
-
1
;
unsigned
char
*
map
=
NULL
;
unsigned
char
*
map
=
NULL
;
void
*
addr
=
NULL
;
void
*
addr
=
NULL
;
unsigned
long
pfn
,
nrpages
;
unsigned
long
pfn
,
nrpages
;
...
@@ -353,22 +353,14 @@ static int dump_one_shmem(struct shmem_info_dump *si)
...
@@ -353,22 +353,14 @@ static int dump_one_shmem(struct shmem_info_dump *si)
continue
;
continue
;
if
(
pb_write_one
(
fd
,
&
pe
,
PB_PAGEMAP
))
if
(
pb_write_one
(
fd
,
&
pe
,
PB_PAGEMAP
))
break
;
goto
err_close2
;
if
(
write
(
fd_pg
,
addr
+
pe
.
vaddr
,
pe
.
nr_pages
*
PAGE_SIZE
)
!=
if
(
write
(
fd_pg
,
addr
+
pe
.
vaddr
,
pe
.
nr_pages
*
PAGE_SIZE
)
!=
pe
.
nr_pages
*
PAGE_SIZE
)
pe
.
nr_pages
*
PAGE_SIZE
)
break
;
goto
err_close2
;
pe
.
nr_pages
=
0
;
pe
.
nr_pages
=
0
;
}
}
ret
=
0
;
if
(
pfn
!=
nrpages
)
goto
err_close2
;
close
(
fd_pg
);
close
(
fd
);
munmap
(
addr
,
si
->
size
);
xfree
(
map
);
return
0
;
err_close2:
err_close2:
close
(
fd_pg
);
close
(
fd_pg
);
...
@@ -378,7 +370,7 @@ err_unmap:
...
@@ -378,7 +370,7 @@ err_unmap:
munmap
(
addr
,
si
->
size
);
munmap
(
addr
,
si
->
size
);
err:
err:
xfree
(
map
);
xfree
(
map
);
return
-
1
;
return
ret
;
}
}
#define for_each_shmem_dump(_i, _si) \
#define for_each_shmem_dump(_i, _si) \
...
...
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