compile error of tcp/zoneserver.c in 1.3.07.08

Boris Dores babal at via.ecp.fr
Fri Jun 13 06:18:49 EDT 2008


On Fri, Jun 13, 2008 at 10:31:41AM (GMT+0900), Koh-ichi Ito wrote:
> Though I'm not sure wheather it is right or wrong, the
> following patch is efficient to avoid the above error.
> 
> *** maradns-1.3.07.08/tcp/zoneserver.c-dist	Wed Dec 26 04:14:46 2007
> --- maradns-1.3.07.08/tcp/zoneserver.c	Thu Apr 10 15:19:25 2008
> ***************
> *** 1014,1020 ****
>       js_string *synth_soa_origin;
>   
>       /* Kill children processes when we are signaled */
> !     if(setpgrp()) {
>           printf(strerror(errno)); /* harderror() would kill the group which may not be correct yet */
>           return 3;
>       }
> --- 1014,1020 ----
>       js_string *synth_soa_origin;
>   
>       /* Kill children processes when we are signaled */
> !     if(setpgrp(0, getpid())) {
>           printf(strerror(errno)); /* harderror() would kill the group which may not be correct yet */
>           return 3;
>       }

  Actually, these lines comes from a patch of my own that Sam kindly
applied. So I will try to answer this one.

  I could not test my patch on FreeBSD, and according to [1], it seems
that you did find a bug. Unfortunately however, the above proposed
patch won't compile on Linux.

  1. http://manpages.courier-mta.org/htmlman2/setpgid.2.html

  The proper solution seems to be to replace "setpgrp()" by
"setpgid(0,0)" (or to #ifdef based on the platform which seems
unnecessary here).

  I have checked that this new fix works on Linux. Could you please
recompile with this change, and tell us if it works ok on BSD (the
purpose of these lines is that if you kill the parent process, it must
kill all children too) ?

  If it does, I think it will be safe for Sam to apply this correction.

-- 
Boris Dorès


More information about the list mailing list