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
d48d6c72
Commit
d48d6c72
authored
Apr 15, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
posix-timers: Helper for freeing proc parsed data
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
b54e3409
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
posix-timer.h
include/posix-timer.h
+1
-0
parasite-syscall.c
parasite-syscall.c
+1
-6
proc_parse.c
proc_parse.c
+11
-5
No files found.
include/posix-timer.h
View file @
d48d6c72
...
@@ -22,5 +22,6 @@ struct proc_posix_timers_stat {
...
@@ -22,5 +22,6 @@ struct proc_posix_timers_stat {
};
};
extern
int
parse_posix_timers
(
pid_t
pid
,
struct
proc_posix_timers_stat
*
args
);
extern
int
parse_posix_timers
(
pid_t
pid
,
struct
proc_posix_timers_stat
*
args
);
void
free_posix_timers
(
struct
proc_posix_timers_stat
*
st
);
#endif
/* __CR_PROC_POSIX_TIMER_H__ */
#endif
/* __CR_PROC_POSIX_TIMER_H__ */
parasite-syscall.c
View file @
d48d6c72
...
@@ -702,12 +702,7 @@ int parasite_dump_posix_timers_seized(struct proc_posix_timers_stat *proc_args,
...
@@ -702,12 +702,7 @@ int parasite_dump_posix_timers_seized(struct proc_posix_timers_stat *proc_args,
}
}
end_posix:
end_posix:
while
(
!
list_empty
(
&
proc_args
->
timers
))
{
free_posix_timers
(
proc_args
);
temp
=
list_first_entry
(
&
proc_args
->
timers
,
struct
proc_posix_timer
,
list
);
list_del
(
&
temp
->
list
);
xfree
(
temp
);
}
return
ret
;
return
ret
;
}
}
...
...
proc_parse.c
View file @
d48d6c72
...
@@ -1337,6 +1337,16 @@ err:
...
@@ -1337,6 +1337,16 @@ err:
return
ret
;
return
ret
;
}
}
void
free_posix_timers
(
struct
proc_posix_timers_stat
*
st
)
{
while
(
!
list_empty
(
&
st
->
timers
))
{
struct
proc_posix_timer
*
timer
;
timer
=
list_first_entry
(
&
st
->
timers
,
struct
proc_posix_timer
,
list
);
list_del
(
&
timer
->
list
);
xfree
(
timer
);
}
}
int
parse_posix_timers
(
pid_t
pid
,
struct
proc_posix_timers_stat
*
args
)
int
parse_posix_timers
(
pid_t
pid
,
struct
proc_posix_timers_stat
*
args
)
{
{
int
ret
=
0
;
int
ret
=
0
;
...
@@ -1409,11 +1419,7 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args)
...
@@ -1409,11 +1419,7 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args)
args
->
timer_n
++
;
args
->
timer_n
++
;
}
}
err:
err:
while
(
!
list_empty
(
&
args
->
timers
))
{
free_posix_timers
(
args
);
timer
=
list_first_entry
(
&
args
->
timers
,
struct
proc_posix_timer
,
list
);
list_del
(
&
timer
->
list
);
xfree
(
timer
);
}
pr_perror
(
"Parse error in posix timers proc file!"
);
pr_perror
(
"Parse error in posix timers proc file!"
);
ret
=
-
1
;
ret
=
-
1
;
out:
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