public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/2] setpgid/setpgid01.c: cleanup
Date: Fri, 16 May 2014 02:44:42 -0400 (EDT)	[thread overview]
Message-ID: <46592848.6574553.1400222682233.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <53757A75.7000101@cn.fujitsu.com>





----- Original Message -----
> From: "Xiaoguang Wang" <wangxg.fnst@cn.fujitsu.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp-list@lists.sourceforge.net
> Sent: Friday, 16 May, 2014 4:39:49 AM
> Subject: Re: [LTP] [PATCH 1/2] setpgid/setpgid01.c: cleanup
> 

> >>  
> > Hi,
> >
> >> +	/*
> >> +	 * Make sure current process is NOT a session or pgrp leader
> >> +	 */
> >>  	if (pgid == pid) {
> > What if we dropped the condition above and always make a child?
> > If we do that, then setpgid_test1() and setpgid_test2() are almost the
> > same,
> > with the difference of arguments you pass to setpgid(), so there's a chance
> > to re-use some code.
> >
> > Thinking about it a bit more, is there any reason we need a child process?
> 
> For pid = 0 & pgid = 0 test, I think we should have tests in child process,
> because in this case, according to setpgid()'s manpge, this will set
> child process's PGID to its PID, we should verify this.

"If pgid is zero, then the PGID of the process specified by pid is made the
same as its process ID."

I see. So, for "setpgid(0, 0);" it makes a difference and it
actually changes PGID to a different value. I'll have a look at v2
later today.

Regards,
Jan

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2014-05-16  6:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12  6:09 [LTP] [PATCH 1/2] setpgid/setpgid01.c: cleanup Xiaoguang Wang
2014-05-12  6:09 ` [LTP] [PATCH 2/2] setpgid/setpgid01.c: add pid = 0 and pgid = 0 test Xiaoguang Wang
2014-05-14 10:05 ` [LTP] [PATCH 1/2] setpgid/setpgid01.c: cleanup Jan Stancek
2014-05-16  2:39   ` Xiaoguang Wang
2014-05-16  6:44     ` Jan Stancek [this message]

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=46592848.6574553.1400222682233.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangxg.fnst@cn.fujitsu.com \
    /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