mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
util: set cr_errno to ESRCH if no PID dir in proc
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
ef283e505c
commit
b09a88b5f9
2 changed files with 8 additions and 0 deletions
|
|
@ -4,4 +4,9 @@
|
|||
void set_cr_errno(int err);
|
||||
int get_cr_errno(void);
|
||||
|
||||
/*
|
||||
* List of symbolic error names:
|
||||
* ESRCH - no process can be found corresponding to that specified by pid
|
||||
*/
|
||||
|
||||
#endif /* __CR_ERRNO_H__ */
|
||||
|
|
|
|||
3
util.c
3
util.c
|
|
@ -43,6 +43,8 @@
|
|||
#include "cr-service.h"
|
||||
#include "files.h"
|
||||
|
||||
#include "cr-errno.h"
|
||||
|
||||
#define VMA_OPT_LEN 128
|
||||
|
||||
static void vma_opt_str(const struct vma_area *v, char *opt)
|
||||
|
|
@ -274,6 +276,7 @@ inline int open_pid_proc(pid_t pid)
|
|||
fd = openat(dfd, path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
pr_perror("Can't open %s", path);
|
||||
set_cr_errno(ESRCH);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue