Re: tcpbench: setpgid

2012-01-31 Thread Henning Brauer
* Erik Lax  [2012-01-31 16:51]:
> I noticed that tcpbench tries to setpgid() for no obvious reason (to
> me) since it's not forked anymore. Previously, 2 years ago it was
> fork()ed and utilized killpg() etc. Could this be a leftover? I'm
> running into issues spawning tcpbench since my parent process uses
> setsid().

you're right. good catch!

-- 
Henning Brauer, h...@bsws.de, henn...@openbsd.org
BS Web Services, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS Services. Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/



Re: tcpbench: setpgid

2012-01-31 Thread Christiano F. Haesbaert
On 31 January 2012 13:50, Erik Lax  wrote:
> Hi,
>
> I noticed that tcpbench tries to setpgid() for no obvious reason (to me)
> since it's not forked anymore. Previously, 2 years ago it was fork()ed and
> utilized killpg() etc. Could this be a leftover? I'm running into issues
> spawning tcpbench since my parent process uses setsid().
>
> I attached a patch (against 5.0) to remove the code :)
>
> Regards
> Erik Lax
>
> Index: usr.bin/tcpbench/tcpbench.c
> ===
> RCS file: /cvs/src/usr.bin/tcpbench/tcpbench.c,v
> retrieving revision 1.22
> diff -u -r1.22 tcpbench.c
> --- usr.bin/tcpbench/tcpbench.c 21 Jun 2011 17:31:07 -  1.22
> +++ usr.bin/tcpbench/tcpbench.c 31 Jan 2012 10:27:50 -
> @@ -703,9 +703,6 @@
>struct event *ev;
>nfds_t lnfds;
>
> -   if (setpgid(0, 0) == -1)
> -   err(1, "setpgid");
> -
>lnfds = 0;
>for (ai = aitop; ai != NULL; ai = ai->ai_next) {
>saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp, sizeof(tmp));
>

Commited, thanks



Re: tcpbench: setpgid

2012-01-31 Thread Christiano F. Haesbaert
On 31 January 2012 13:50, Erik Lax  wrote:
> Hi,
>
> I noticed that tcpbench tries to setpgid() for no obvious reason (to me)
> since it's not forked anymore. Previously, 2 years ago it was fork()ed and
> utilized killpg() etc. Could this be a leftover? I'm running into issues
> spawning tcpbench since my parent process uses setsid().
>
> I attached a patch (against 5.0) to remove the code :)
>

You're correct nice catch :-).


> Regards
> Erik Lax
>
> Index: usr.bin/tcpbench/tcpbench.c
> ===
> RCS file: /cvs/src/usr.bin/tcpbench/tcpbench.c,v
> retrieving revision 1.22
> diff -u -r1.22 tcpbench.c
> --- usr.bin/tcpbench/tcpbench.c 21 Jun 2011 17:31:07 -  1.22
> +++ usr.bin/tcpbench/tcpbench.c 31 Jan 2012 10:27:50 -
> @@ -703,9 +703,6 @@
>struct event *ev;
>nfds_t lnfds;
>
> -   if (setpgid(0, 0) == -1)
> -   err(1, "setpgid");
> -
>lnfds = 0;
>for (ai = aitop; ai != NULL; ai = ai->ai_next) {
>saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp, sizeof(tmp));



tcpbench: setpgid

2012-01-31 Thread Erik Lax

Hi,

I noticed that tcpbench tries to setpgid() for no obvious reason (to me) 
since it's not forked anymore. Previously, 2 years ago it was fork()ed 
and utilized killpg() etc. Could this be a leftover? I'm running into 
issues spawning tcpbench since my parent process uses setsid().


I attached a patch (against 5.0) to remove the code :)

Regards
Erik Lax

Index: usr.bin/tcpbench/tcpbench.c
===
RCS file: /cvs/src/usr.bin/tcpbench/tcpbench.c,v
retrieving revision 1.22
diff -u -r1.22 tcpbench.c
--- usr.bin/tcpbench/tcpbench.c 21 Jun 2011 17:31:07 -  1.22
+++ usr.bin/tcpbench/tcpbench.c 31 Jan 2012 10:27:50 -
@@ -703,9 +703,6 @@
struct event *ev;
nfds_t lnfds;

-   if (setpgid(0, 0) == -1)
-   err(1, "setpgid");
-
lnfds = 0;
for (ai = aitop; ai != NULL; ai = ai->ai_next) {
saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp, sizeof(tmp));