[CRIU] [PATCH 16/20] util: use PROC_SELF in vaddr_to_pfn() for open_proc()

Dmitry Safonov dsafonov at virtuozzo.com
Fri Dec 2 11:53:40 PST 2016


Just a little optimization (one syscall less).

Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/util.c b/criu/util.c
index efd5f0c94dca..7c692939f079 100644
--- a/criu/util.c
+++ b/criu/util.c
@@ -765,7 +765,7 @@ int vaddr_to_pfn(unsigned long vaddr, u64 *pfn)
 	int fd, ret = -1;
 	off_t off;
 
-	fd = open_proc(getpid(), "pagemap");
+	fd = open_proc(PROC_SELF, "pagemap");
 	if (fd < 0)
 		return -1;
 
-- 
2.10.2



More information about the CRIU mailing list