[02/10] util: Rename move_img_fd

Submitted by Pavel Emelianov on May 20, 2016, 4:52 p.m.

Details

Message ID 573F40D0.8020202@virtuozzo.com
State Accepted
Series "Some cleanups over headers"
Commit 67011f51639d2ff1c6a10f405892ccb440db0696
Headers show

Commit Message

Pavel Emelianov May 20, 2016, 4:52 p.m.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/files.c        | 2 +-
 criu/include/util.h | 2 +-
 criu/mount.c        | 2 +-
 criu/util.c         | 8 ++++----
 4 files changed, 7 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/files.c b/criu/files.c
index 9a5174c..16bc74d 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -922,7 +922,7 @@  static int send_fd_to_self(int fd, struct fdinfo_list_entry *fle, int *sock)
 		return -1;
 
 	pr_info("\t\t\tGoing to dup %d into %d\n", fd, dfd);
-	if (move_img_fd(sock, dfd))
+	if (move_fd_from(sock, dfd))
 		return -1;
 
 	if (dup2(fd, dfd) != dfd) {
diff --git a/criu/include/util.h b/criu/include/util.h
index 808b66a..3a1a092 100644
--- a/criu/include/util.h
+++ b/criu/include/util.h
@@ -50,7 +50,7 @@  extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area);
 	} while (0)
 #define pr_info_vma_list(head)	pr_vma_list(LOG_INFO, head)
 
-extern int move_img_fd(int *img_fd, int want_fd);
+extern int move_fd_from(int *img_fd, int want_fd);
 extern int close_safe(int *fd);
 
 extern int reopen_fd_as_safe(char *file, int line, int new_fd, int old_fd, bool allow_reuse_fd);
diff --git a/criu/mount.c b/criu/mount.c
index bf3b23f..22e62a8 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -1268,7 +1268,7 @@  static int tmpfs_dump(struct mount_info *pm)
 	 * non-zero, because cr_system_userns closes STDIN_FILENO as we are not
 	 * interested in passing stdin to tar.
 	 */
-	if (move_img_fd(&fd, STDIN_FILENO) < 0)
+	if (move_fd_from(&fd, STDIN_FILENO) < 0)
 		goto out;
 
 	if (fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) & ~FD_CLOEXEC) == -1) {
diff --git a/criu/util.c b/criu/util.c
index b647c37..7a6e42a 100644
--- a/criu/util.c
+++ b/criu/util.c
@@ -218,7 +218,7 @@  int reopen_fd_as_safe(char *file, int line, int new_fd, int old_fd, bool allow_r
 	return 0;
 }
 
-int move_img_fd(int *img_fd, int want_fd)
+int move_fd_from(int *img_fd, int want_fd)
 {
 	if (*img_fd == want_fd) {
 		int tmp;
@@ -621,8 +621,8 @@  int cr_system_userns(int in, int out, int err, char *cmd,
 		if (out == in)
 			out = DUP_SAFE(out, out_chld);
 
-		if (move_img_fd(&out, STDIN_FILENO) ||
-		    move_img_fd(&err, STDIN_FILENO))
+		if (move_fd_from(&out, STDIN_FILENO) ||
+		    move_fd_from(&err, STDIN_FILENO))
 			goto out_chld;
 
 		if (in < 0) {
@@ -632,7 +632,7 @@  int cr_system_userns(int in, int out, int err, char *cmd,
 				goto out_chld;
 		}
 
-		if (move_img_fd(&err, STDOUT_FILENO))
+		if (move_fd_from(&err, STDOUT_FILENO))
 			goto out_chld;
 
 		if (reopen_fd_as_nocheck(STDOUT_FILENO, out))