Linux Test Project
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] pty/pty07: Restore active console after the testrun
Date: Tue, 22 Mar 2022 08:13:26 +0000	[thread overview]
Message-ID: <875yo6cr1f.fsf@suse.de> (raw)
In-Reply-To: <YisfIWsrgxVt8xc2@yuki>

Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> >  static void cleanup(void)
>> >  {
>> > -	tst_fzsync_pair_cleanup(&fzp);
>> > -	if (fd >= 0)
>> > +	if (fd >= 0) {
>> > +		tst_res(TINFO, "Restoring active console");
>> > +		SAFE_IOCTL(fd, VT_ACTIVATE, vt_active);
>> >  		SAFE_CLOSE(fd);
>> > +	}
>> > +
>> > +	tst_fzsync_pair_cleanup(&fzp);
>> 
>> If you move the fzsync cleanup to the end of cleanup(), you can end up
>> with the open_close() thread racing against fd cleanup.
>
> Ah, right, looking closely at the fzsync, the thread B may be racing
> against the restoration in the case that something caused premature exit
> in the thread A.
>
> Will move the call back to the start of the cleanup().
>
> -- 
> Cyril Hrubis
> chrubis@suse.cz

Why are we using /dev/tty8 instead of allocating a pty with /dev/ptmx?

-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-03-22  8:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11  9:51 [LTP] [PATCH] pty/pty07: Restore active console after the testrun Cyril Hrubis
2022-03-11  9:56 ` Martin Doucha
2022-03-11 10:06   ` Cyril Hrubis
2022-03-22  8:13     ` Richard Palethorpe [this message]
2022-03-22  9:34       ` Cyril Hrubis
2022-03-22 11:41         ` Richard Palethorpe
2022-03-22 12:05           ` 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=875yo6cr1f.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=chrubis@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox