From: Christian Brauner Date: Fri, 19 Jun 2020 21:59:46 +0000 (+0200) Subject: test: update terminology X-Git-Tag: lxc-5.0.0~411^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=992a0a6799255cb4fa4a8a32e852b1e0346ba93a;p=thirdparty%2Flxc.git test: update terminology Signed-off-by: Christian Brauner --- diff --git a/src/tests/console.c b/src/tests/console.c index c0ad16033..c88f4329b 100644 --- a/src/tests/console.c +++ b/src/tests/console.c @@ -37,14 +37,14 @@ } while (0) static void test_console_close_all(int ttyfd[MAXCONSOLES], - int masterfd[MAXCONSOLES]) + int ptmxfd[MAXCONSOLES]) { int i; for (i = 0; i < MAXCONSOLES; i++) { - if (masterfd[i] != -1) { - close(masterfd[i]); - masterfd[i] = -1; + if (ptmxfd[i] != -1) { + close(ptmxfd[i]); + ptmxfd[i] = -1; } if (ttyfd[i] != -1) { @@ -59,14 +59,14 @@ static int test_console_running_container(struct lxc_container *c) int nrconsoles, i, ret = -1; int ttynum [MAXCONSOLES]; int ttyfd [MAXCONSOLES]; - int masterfd[MAXCONSOLES]; + int ptmxfd[MAXCONSOLES]; for (i = 0; i < MAXCONSOLES; i++) - ttynum[i] = ttyfd[i] = masterfd[i] = -1; + ttynum[i] = ttyfd[i] = ptmxfd[i] = -1; ttynum[0] = 1; - ret = c->console_getfd(c, &ttynum[0], &masterfd[0]); + ret = c->console_getfd(c, &ttynum[0], &ptmxfd[0]); if (ret < 0) { TSTERR("console allocate failed"); goto err1; @@ -79,12 +79,12 @@ static int test_console_running_container(struct lxc_container *c) } /* attempt to alloc same ttynum */ - ret = c->console_getfd(c, &ttynum[0], &masterfd[1]); + ret = c->console_getfd(c, &ttynum[0], &ptmxfd[1]); if (ret != -1) { TSTERR("console allocate should fail for allocated ttynum %d", ttynum[0]); goto err2; } - close(masterfd[0]); masterfd[0] = -1; + close(ptmxfd[0]); ptmxfd[0] = -1; close(ttyfd[0]); ttyfd[0] = -1; /* ensure we can allocate all consoles, we do this a few times to @@ -92,7 +92,7 @@ static int test_console_running_container(struct lxc_container *c) */ for (i = 0; i < 10; i++) { for (nrconsoles = 0; nrconsoles < MAXCONSOLES; nrconsoles++) { - ret = c->console_getfd(c, &ttynum[nrconsoles], &masterfd[nrconsoles]); + ret = c->console_getfd(c, &ttynum[nrconsoles], &ptmxfd[nrconsoles]); if (ret < 0) break; ttyfd[nrconsoles] = ret; @@ -103,13 +103,13 @@ static int test_console_running_container(struct lxc_container *c) goto err2; } - test_console_close_all(ttyfd, masterfd); + test_console_close_all(ttyfd, ptmxfd); } ret = 0; err2: - test_console_close_all(ttyfd, masterfd); + test_console_close_all(ttyfd, ptmxfd); err1: return ret;