diff options
Diffstat (limited to 'login/forkpty.c')
-rw-r--r-- | login/forkpty.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/login/forkpty.c b/login/forkpty.c index 1e91bd8198..79f9846ac4 100644 --- a/login/forkpty.c +++ b/login/forkpty.c @@ -21,34 +21,41 @@ #include <unistd.h> #include <utmp.h> #include <pty.h> +#include <shlib-compat.h> int -forkpty (int *amaster, char *name, const struct termios *termp, - const struct winsize *winp) +__forkpty (int *pptmx, char *name, const struct termios *termp, + const struct winsize *winp) { - int master, slave, pid; + int ptmx, terminal, pid; - if (openpty (&master, &slave, name, termp, winp) == -1) + if (openpty (&ptmx, &terminal, name, termp, winp) == -1) return -1; - switch (pid = fork ()) + switch (pid = __fork ()) { case -1: - close (master); - close (slave); + __close (ptmx); + __close (terminal); return -1; case 0: /* Child. */ - close (master); - if (login_tty (slave)) + __close (ptmx); + if (login_tty (terminal)) _exit (1); return 0; default: /* Parent. */ - *amaster = master; - close (slave); + *pptmx = ptmx; + __close (terminal); return pid; } } +versioned_symbol (libc, __forkpty, forkpty, GLIBC_2_34); +libc_hidden_ver (__forkpty, forkpty) + +#if OTHER_SHLIB_COMPAT (libutil, GLIBC_2_0, GLIBC_2_34) +compat_symbol (libutil, __forkpty, forkpty, GLIBC_2_0); +#endif |