Commit db77402a authored by Pavel Emelyanov's avatar Pavel Emelyanov

proc: Use open_proc helper to open timers file

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1f5acc02
...@@ -1165,7 +1165,6 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args) ...@@ -1165,7 +1165,6 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args)
int ret = 0; int ret = 0;
int get = 0; int get = 0;
int pid_t; int pid_t;
char path[128];
FILE * file; FILE * file;
char * line1 = NULL; char * line1 = NULL;
...@@ -1188,8 +1187,7 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args) ...@@ -1188,8 +1187,7 @@ int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat *args)
INIT_LIST_HEAD(&args->timers); INIT_LIST_HEAD(&args->timers);
args->timer_n = 0; args->timer_n = 0;
sprintf(path, "/proc/%d/timers", pid); file = fopen_proc(pid, "timers");
file = fopen(path, "r");
if (file == NULL) { if (file == NULL) {
pr_perror("Can't open posix timers file!"); pr_perror("Can't open posix timers file!");
ret = -1; ret = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment