Path: blob/main/ftp/gftp/files/patch-lib-pty.c
16461 views
--- lib/pty.c.orig 2022-02-15 06:31:19 UTC1+++ lib/pty.c2@@ -91,7 +91,9 @@ _gftp_ptys_open (int fdm, int fds, char *pts_name)3#include <utmp.h> /* for login_tty */4#elif HAVE_LIBUTIL_H5#include <libutil.h>6-#include <utmp.h> /* for login_tty */7+#else8+extern int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize * winp);9+extern int login_tty(int fd);10#endif1112char *13@@ -118,8 +120,10 @@ _gftp_ptys_open (int fdm, int fds, char *pts_name)14static int15_gftp_ptys_open (int fdm, int fds, char *pts_name)16{17- if (login_tty (fds) < 0)18+ if (login_tty (fds) < 0) {19+ close(fds);20return (GFTP_EFATAL);21+ }2223return (fds);24}252627