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
6e960f1f
Commit
6e960f1f
authored
Sep 16, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc: Use fopen_proc in fdinfo parsing
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
6b70e4ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
proc_parse.c
proc_parse.c
+4
-8
No files found.
proc_parse.c
View file @
6e960f1f
...
...
@@ -1127,7 +1127,7 @@ nodata:
#define fdinfo_field(str, field) !strncmp(str, field":", sizeof(field))
static
int
parse_fdinfo_pid_s
(
char
*
pid
,
int
fd
,
int
type
,
static
int
parse_fdinfo_pid_s
(
int
pid
,
int
fd
,
int
type
,
int
(
*
cb
)(
union
fdinfo_entries
*
e
,
void
*
arg
),
void
*
arg
)
{
FILE
*
f
;
...
...
@@ -1135,8 +1135,7 @@ static int parse_fdinfo_pid_s(char *pid, int fd, int type,
bool
entry_met
=
false
;
int
ret
=
-
1
;
sprintf
(
str
,
"/proc/%s/fdinfo/%d"
,
pid
,
fd
);
f
=
fopen
(
str
,
"r"
);
f
=
fopen_proc
(
pid
,
"fdinfo/%d"
,
fd
);
if
(
!
f
)
{
pr_perror
(
"Can't open %s to parse"
,
str
);
return
-
1
;
...
...
@@ -1402,16 +1401,13 @@ out:
int
parse_fdinfo_pid
(
int
pid
,
int
fd
,
int
type
,
int
(
*
cb
)(
union
fdinfo_entries
*
e
,
void
*
arg
),
void
*
arg
)
{
char
pid_s
[
10
];
sprintf
(
pid_s
,
"%d"
,
pid
);
return
parse_fdinfo_pid_s
(
pid_s
,
fd
,
type
,
cb
,
arg
);
return
parse_fdinfo_pid_s
(
pid
,
fd
,
type
,
cb
,
arg
);
}
int
parse_fdinfo
(
int
fd
,
int
type
,
int
(
*
cb
)(
union
fdinfo_entries
*
e
,
void
*
arg
),
void
*
arg
)
{
return
parse_fdinfo_pid_s
(
"self"
,
fd
,
type
,
cb
,
arg
);
return
parse_fdinfo_pid_s
(
PROC_SELF
,
fd
,
type
,
cb
,
arg
);
}
static
int
parse_file_lock_buf
(
char
*
buf
,
struct
file_lock
*
fl
,
...
...
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