[CRIU] [PATCH 1/3] logfd: Distinguish functions which do setup logdf

Cyrill Gorcunov gorcunov at openvz.org
Mon Feb 27 05:03:29 EST 2012


We have a few helper functions which all do setup
logfd but in different program flow context. So
rename them just to be able to distinguish them
without much effort.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/restorer-log.h |    2 +-
 parasite.c             |    4 ++--
 restorer-log.c         |    2 +-
 restorer.c             |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/restorer-log.h b/include/restorer-log.h
index f038dd0..7a2316f 100644
--- a/include/restorer-log.h
+++ b/include/restorer-log.h
@@ -7,5 +7,5 @@ extern void write_num_n(long num);
 extern void write_num(long num);
 extern void write_string_n(char *str);
 extern void write_string(char *str);
-extern void set_logfd(int fd);
+extern void restorer_set_logfd(int fd);
 #endif
diff --git a/parasite.c b/parasite.c
index f886ee8..c6487a4 100644
--- a/parasite.c
+++ b/parasite.c
@@ -411,7 +411,7 @@ static int init(struct parasite_init_args *args)
 	return ret;
 }
 
-static int set_logfd(void)
+static int obtain_logfd(void)
 {
 	logfd = recv_fd(tsock);
 	return logfd;
@@ -442,7 +442,7 @@ static int __used parasite_service(unsigned long cmd, void *args, void *brk)
 	case PARASITE_CMD_FINI:
 		return fini();
 	case PARASITE_CMD_SET_LOGFD:
-		return set_logfd();
+		return obtain_logfd();
 	case PARASITE_CMD_DUMPPAGES_INIT:
 		return dump_pages_init((parasite_status_t *) args);
 	case PARASITE_CMD_DUMPPAGES_FINI:
diff --git a/restorer-log.c b/restorer-log.c
index 858e360..634513e 100644
--- a/restorer-log.c
+++ b/restorer-log.c
@@ -3,7 +3,7 @@
 
 static int logfd;
 
-void set_logfd(int fd)
+void restorer_set_logfd(int fd)
 {
 	logfd = fd;
 }
diff --git a/restorer.c b/restorer.c
index 552f741..ecffd7e 100644
--- a/restorer.c
+++ b/restorer.c
@@ -352,7 +352,7 @@ long restore_task(struct task_restore_core_args *args)
 	act.rt_sa_handler = sigchld_handler;
 	sys_sigaction(SIGCHLD, &act, NULL);
 
-	set_logfd(args->logfd);
+	restorer_set_logfd(args->logfd);
 
 	core_entry	= first_on_heap(core_entry, args->mem_zone.heap);
 	vma_entry	= next_on_heap(vma_entry, core_entry);
-- 
1.7.7.6



More information about the CRIU mailing list