[lxc-devel] [lxc/master] lxccontainer: use correct pid_t type

brauner on Github lxc-bot at linuxcontainers.org
Tue Sep 11 08:35:30 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180911/c5c3c6c4/attachment.bin>
-------------- next part --------------
From 11cff75a12205cf9e159a69fb89b7025b195873e Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 11 Sep 2018 10:34:41 +0200
Subject: [PATCH] lxccontainer: use correct pid_t type

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/lxccontainer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index 31b910897..5574514cf 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -1040,9 +1040,9 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
 	 */
 	if (c->pidfile) {
 		int ret, w;
-		char pidstr[INTTYPE_TO_STRLEN(int)];
+		char pidstr[INTTYPE_TO_STRLEN(pid_t)];
 
-		w = snprintf(pidstr, sizeof(pidstr), "%d", (int)lxc_raw_getpid());
+		w = snprintf(pidstr, sizeof(pidstr), "%d", lxc_raw_getpid());
 		if (w < 0 || (size_t)w >= sizeof(pidstr)) {
 			free_init_cmd(init_cmd);
 			lxc_free_handler(handler);


More information about the lxc-devel mailing list