From: Marius Kittler <mkittler@suse.de>
To: ltp <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v1] Avoid messing with system tty in ioctl01.c
Date: Mon, 11 Sep 2023 17:23:27 +0200 [thread overview]
Message-ID: <5969670.lOV4Wx5bFT@linux-9lzf> (raw)
In-Reply-To: <ZP8u7Zf0GZpi5TpF@yuki>
Am Montag, 11. September 2023, 17:14:53 CEST schrieb Cyril Hrubis:
> Hi!
>
> > * Use `openpty()` to create a new tty
> > * Remove `-D` option
> > * Remove requirement to run as root
> >
> > Signed-off-by: Marius Kittler <mkittler@suse.de>
> > ---
> >
> > runtest/syscalls | 2 +-
> > testcases/kernel/syscalls/ioctl/ioctl01.c | 25 ++++++++++------------
> > testcases/kernel/syscalls/ioctl/test_ioctl | 23 --------------------
> > 3 files changed, 12 insertions(+), 38 deletions(-)
> >
> > diff --git a/runtest/syscalls b/runtest/syscalls
> > index b1125dd75..f999bd74f 100644
> > --- a/runtest/syscalls
> > +++ b/runtest/syscalls
> > @@ -557,10 +557,10 @@ init_module01 init_module01
> >
> > init_module02 init_module02
> >
> > #Needs tty device.
> >
> > -#ioctl01 ioctl01 -D /dev/tty0
> >
> > #ioctl02 ioctl02 -D /dev/tty0
> >
> > # Introducing ioctl tests for all /dev/tty* devices
> >
> > +ioctl01 ioctl01
> >
> > ioctl01_02 test_ioctl
>
> This should be renamed to ioctl02 now I suppose.
>
Right, this should now be the only remaining test in `test_ioctl`.
> >
> > - if (!device)
> > - tst_brk(TBROK, "You must specify a tty device with -D
option");
> > + if (openpty(&amaster, &aslave, NULL, &termios, NULL) < 0) {
> > + tst_brk(TBROK | TERRNO, "unable to open pty");
> > + }
>
> It's better just to pass NULL instead of the zero filled &termios here.
>
Makes sense.
> The rest looks good to me, if you agree I can merge the patch with the
> changes I've proposed.
Yes, go ahead.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-09-11 15:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 12:04 [LTP] [PATCH v1] Avoid messing with system tty in ioctl01.c Marius Kittler
2023-09-11 15:14 ` Cyril Hrubis
2023-09-11 15:23 ` Marius Kittler [this message]
2023-09-13 11:07 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5969670.lOV4Wx5bFT@linux-9lzf \
--to=mkittler@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.