]> git.proxmox.com Git - mirror_lxc.git/commitdiff
openpty: adapt variable naming
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Jun 2020 21:54:07 +0000 (23:54 +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/include/openpty.c
src/include/openpty.h

index 01579c517a34f361313405f4fd5d2a9f4147ce6e..7804d4c983be0a9ee1b352e38d7518e95f39c04c 100644 (file)
 
 #define _PATH_DEVPTMX "/dev/ptmx"
 
-int openpty (int *amaster, int *aslave, char *name, struct termios *termp,
+int openpty (int *aptmx, int *apts, char *name, struct termios *termp,
        struct winsize *winp)
 {
    char buf[PATH_MAX];
-   int master, slave;
+   int ptmx, pts;
 
-   master = open(_PATH_DEVPTMX, O_RDWR);
-   if (master == -1)
+   ptmx = open(_PATH_DEVPTMX, O_RDWR);
+   if (ptmx == -1)
        return -1;
 
-   if (grantpt(master))
+   if (grantpt(ptmx))
        goto fail;
 
-   if (unlockpt(master))
+   if (unlockpt(ptmx))
        goto fail;
 
-   if (ptsname_r(master, buf, sizeof buf))
+   if (ptsname_r(ptmx, buf, sizeof buf))
        goto fail;
 
-   slave = open(buf, O_RDWR | O_NOCTTY);
-   if (slave == -1)
+   pts = open(buf, O_RDWR | O_NOCTTY);
+   if (pts == -1)
        goto fail;
 
    /* XXX Should we ignore errors here?  */
    if (termp)
-       tcsetattr(slave, TCSAFLUSH, termp);
+       tcsetattr(pts, TCSAFLUSH, termp);
    if (winp)
-       ioctl(slave, TIOCSWINSZ, winp);
+       ioctl(pts, TIOCSWINSZ, winp);
 
-   *amaster = master;
-   *aslave = slave;
+   *aptmx = ptmx;
+   *apts = pts;
    if (name != NULL)
        strcpy(name, buf);
 
    return 0;
 
 fail:
-   close(master);
+   close(ptmx);
    return -1;
 }
index 6e7bf8d2d15446fe422ee0ad56dbf7109c59b09a..cb452e52a66ca462add7cdf2aeaaf0c80b5643b3 100644 (file)
 #include <termios.h>
 #include <sys/ioctl.h>
 
-/* Create pseudo tty master slave pair with NAME and set terminal
-   attributes according to TERMP and WINP and return handles for both
-   ends in AMASTER and ASLAVE.  */
-extern int openpty (int *__amaster, int *__aslave, char *__name,
+/*
+ * Create pseudo tty ptmx pts pair with @__name and set terminal
+ * attributes according to @__termp and @__winp and return handles for both
+ * ends in @__aptmx and @__apts.
+ */
+extern int openpty (int *__aptmx, int *__apts, char *__name,
                    const struct termios *__termp,
                    const struct winsize *__winp);