[CRIU] [PATCHv2 16/22] util: use PROC_SELF in vaddr_to_pfn() for open_proc()

Dmitry Safonov dsafonov at virtuozzo.com
Wed Dec 7 09:56:31 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 8730fb9e598b..1288680e3977 100644
--- a/criu/util.c
+++ b/criu/util.c
@@ -768,7 +768,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