Applied, Thanks!. Anibal
On Fri, 10 Jul 2020 at 00:44, Tero Kinnunen <tero.kinnu...@vaisala.com> wrote: > Fixes error > > ERROR: Unable to detach from controlling tty, Inappropriate ioctl for > device > > when running multiple ptests > > ptest-runner a b > > or when invoked over ssh single command, like > > $ ssh localhost ptest-runner > > For ssh case, fd 0 is not a tty. (isatty(0) is false). > When running multiple ptests, deattach for parent needs to be > done only once. > > Signed-off-by: Tero Kinnunen <tero.kinnu...@vaisala.com> > --- > utils.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/utils.c b/utils.c > index a8ba190..a4e190e 100644 > --- a/utils.c > +++ b/utils.c > @@ -437,6 +437,9 @@ run_ptests(struct ptest_list *head, const struct > ptest_options opts, > break; > } > fprintf(fp, "START: %s\n", progname); > + if (isatty(0) && ioctl(0, TIOCNOTTY) == -1) { > + fprintf(fp, "ERROR: Unable to detach from > controlling tty, %s\n", strerror(errno)); > + } > PTEST_LIST_ITERATE_START(head, p) > char *ptest_dir = strdup(p->run_ptest); > if (ptest_dir == NULL) { > @@ -444,9 +447,6 @@ run_ptests(struct ptest_list *head, const struct > ptest_options opts, > break; > } > dirname(ptest_dir); > - if (ioctl(0, TIOCNOTTY) == -1) { > - fprintf(fp, "ERROR: Unable to detach from > controlling tty, %s\n", strerror(errno)); > - } > > if ((pgid = getpgid(0)) == -1) { > fprintf(fp, "ERROR: getpgid() failed, > %s\n", strerror(errno)); > -- > 2.25.1 > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#49933): https://lists.yoctoproject.org/g/yocto/message/49933 Mute This Topic: https://lists.yoctoproject.org/mt/75413484/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-