On 05/06/13 11:25 AM, Michael Tokarev wrote:
In two places qemu uses openpty() which is very system-dependent,
and in both places the pty is switched to raw mode as well.
Make a wrapper function which does both steps, and move all the
system-dependent complexity into a separate file, together
with static/local implementations of openpty() and cfmakeraw()
from qemu-char.c.

It is in a separate file, not part of oslib-posix.c, because
openpty() often resides in -lutil which is not linked to
every program qemu builds.

This change removes #including of <pty.h>, <termios.h>
and other rather specific system headers out of qemu-common.h,
which isn't a place for such specific headers really.

Signed-off-by: Michael Tokarev <m...@tls.msk.ru>
---
Changes since v1:

- added a forgotten #include <termios.h> for *BSD,
   which was recently added into qemu-common.h by
   Brad Smith, and which I intended to use in
   qemu-openpty.c too, but somehow forgot.

And one extra comment.  I especially took existing
code and used it almost unmodified, to have one
code moving change, with all other possible
improvements/cleanups to follow later.

This builds Ok on OpenBSD.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Reply via email to