]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
test: update terminology 3454/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Jun 2020 21:59:46 +0000 (23:59 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Jun 2020 22:03:29 +0000 (00:03 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/tests/console.c

index c0ad160330323e1ad91112ecaad262fc251b0a2f..c88f4329bf9b2f4486d64898f8057d6c99037422 100644 (file)
 } 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;