Skip to content

Commit

Permalink
script: use lib/pty-session
Browse files Browse the repository at this point in the history
This patch consolidate pseudo-terminal stuff in util-linux. From now
there is only one implementation used in su(1) --pty, scriptlive(1)
and script(1).

The new stuff is based on the original script(1) -- it means poll()
and signalfd() based.

Note that script(1) code does not provide fallback for systems/libc
where is no openpty().

Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed Oct 8, 2019
1 parent f3e55e3 commit ec10634
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 566 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ UL_REQUIRES_LINUX([setarch])
AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes])

UL_BUILD_INIT([script], [check])
UL_REQUIRES_HAVE([script], [sys_signalfd_h], [sys/signalfd.h header])
UL_REQUIRES_HAVE([script], [pty])
AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes])

UL_BUILD_INIT([scriptreplay], [yes])
Expand Down
10 changes: 5 additions & 5 deletions term-utils/Makemodule.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
if BUILD_SCRIPT
usrbin_exec_PROGRAMS += script
dist_man_MANS += term-utils/script.1
script_SOURCES = term-utils/script.c lib/monotonic.c
script_SOURCES = term-utils/script.c \
lib/pty-session.c \
include/pty-session.h \
lib/monotonic.c
script_CFLAGS = $(AM_CFLAGS) -Wno-format-y2k
script_LDADD = $(LDADD) libcommon.la $(REALTIME_LIBS)
if HAVE_UTIL
script_LDADD += -lutil
endif
script_LDADD = $(LDADD) libcommon.la $(MATH_LIBS) $(REALTIME_LIBS) -lutil
if HAVE_UTEMPTER
script_LDADD += -lutempter
endif
Expand Down

0 comments on commit ec10634

Please sign in to comment.