[CRIU] [PATCH 08/18] sk-unix: Use native types in unix_sk_info

Cyrill Gorcunov gorcunov at openvz.org
Wed Apr 12 06:58:28 PDT 2017


I think using native types is better here -- no need
for bitfields used solely as a flags and u32 for not
known profit as well.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/sk-unix.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 54d6d8d8ce0b..0bd6f3670324 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -792,9 +792,9 @@ struct unix_sk_info {
 	 * once although it may be open by more than one tid. This is the peer
 	 * that should do the queueing.
 	 */
-	u32			queuer;
-	u8			bound:1;
-	u8			listen:1;
+	unsigned int		queuer;
+	bool			bound;
+	bool			listen;
 };
 
 #define USK_PAIR_MASTER		0x1
@@ -1076,7 +1076,7 @@ static int bind_unix_sk(int sk, struct unix_sk_info *ui)
 	}
 
 	if (ui->ue->state != TCP_LISTEN) {
-		ui->bound = 1;
+		ui->bound = true;
 		wake_connected_sockets(ui);
 	}
 
@@ -1274,7 +1274,7 @@ static int open_unixsk_standalone(struct unix_sk_info *ui, int *new_fd)
 			pr_perror("Can't make usk listen");
 			return -1;
 		}
-		ui->listen = 1;
+		ui->listen = true;
 		wake_connected_sockets(ui);
 	}
 
@@ -1398,8 +1398,8 @@ static int collect_one_unixsk(void *o, ProtobufCMessage *base, struct cr_img *i)
 
 	ui->queuer = 0;
 	ui->peer = NULL;
-	ui->bound = 0;
-	ui->listen = 0;
+	ui->bound = false;
+	ui->listen = false;
 	INIT_LIST_HEAD(&ui->connected);
 	INIT_LIST_HEAD(&ui->node);
 	ui->flags = 0;
-- 
2.7.4



More information about the CRIU mailing list