mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +00:00
proc_parse: handle errors for breadline()
00:03:27.746 (00.008815) Error (bfd.c:149): bfd: Error reading file: No such process Reported-by: Mr Jenkins Signed-off-by: Andrew Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
a2a0e2f2ed
commit
84c65f00f9
10
proc_parse.c
10
proc_parse.c
@@ -533,6 +533,8 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list)
|
|||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
str = breadline(&f);
|
str = breadline(&f);
|
||||||
|
if (IS_ERR(str))
|
||||||
|
goto err;
|
||||||
eof = (str == NULL);
|
eof = (str == NULL);
|
||||||
|
|
||||||
if (!eof && !is_vma_range_fmt(str)) {
|
if (!eof && !is_vma_range_fmt(str)) {
|
||||||
@@ -761,7 +763,13 @@ int parse_pid_status(pid_t pid, struct proc_status_creds *cr)
|
|||||||
if (bfdopenr(&f))
|
if (bfdopenr(&f))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
while (done < 8 && (str = breadline(&f))) {
|
while (done < 8) {
|
||||||
|
str = breadline(&f);
|
||||||
|
if (str == NULL)
|
||||||
|
break;
|
||||||
|
if (IS_ERR(str))
|
||||||
|
goto err_parse;
|
||||||
|
|
||||||
if (!strncmp(str, "State:", 6)) {
|
if (!strncmp(str, "State:", 6)) {
|
||||||
cr->state = str[7];
|
cr->state = str[7];
|
||||||
done++;
|
done++;
|
||||||
|
Reference in New Issue
Block a user