]> git.ipfire.org Git - thirdparty/systemd.git/commit
terminal-util: introduce openpt_allocate()
authorFranck Bui <fbui@suse.com>
Fri, 7 Jun 2019 08:17:11 +0000 (10:17 +0200)
committerFranck Bui <fbui@suse.com>
Tue, 18 Jun 2019 07:26:31 +0000 (09:26 +0200)
commitae1d13db056ee139f89fbb7cbc893dc5d89ffde3
tree5602b7aac5270cb767e4c0f41f8035f9c33a11a0
parent3acc84ebd9aebe8cf1771b42644ebbfbecdfaa37
terminal-util: introduce openpt_allocate()

Allocating a pty is done in a couple of places so let's introduce a new helper
which does the job.

Also the new function, as well as openpt_in_namespace(), returns both pty
master and slave so the callers don't need to know about the pty slave
allocation details.

For the same reasons machine_openpt() prototype has also been changed to return
both pty master and slave so callers don't need to allocate a pty slave which
might be in a different namespace.

Finally openpt_in_namespace() has been renamed into
openpt_allocate_in_namespace().
src/basic/terminal-util.c
src/basic/terminal-util.h
src/machine/machine-dbus.c
src/machine/machine.c
src/machine/machine.h