[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

router.c: getpgrp() of BSD and SysV styles.

   I got a surprice when I started to compile Zmailer with gcc-2.x
The Sun cc did not produce troubles, however gcc gave  pgrp = -1 :(
In this case using  ppid -parameter all the time works also with SysV-
style calls, as argument is not used..

  And by the way:  A proper ANSI-style prototyping would be nice
for hunting down the bugs...  The gcc-2.2.2 works quite nice for
SunOS 4.1.2 on SPARCs.

  I am presently debugging a case of mail which has following style
header line:  To:  email@address (Persons name (more commentary)),
		   another@email (Another name (with comment))
That file causes router to bomb... (There are 5 recipients of above

	/Matti Aarnio <mea@utu.fi> <mea@Nic.funet.fi>

(This is NOT a context diff! just a sort of presentation to that way,
 as Rayan will undoubtly implement fix slightly differently..)

---- router/router.c: about line 215 ----
  		if (nrouters > 1) {
!  			int pgrp, ppid = getpid();
!  			pgrp = getpgrp(ppid);	/* BSD  -style */
! #else
!  			pgrp = getpgrp();	/* SysV -style */
! #endif
! 			if (pgrp != ppid) {
 				fprintf(stderr, "process group %d != pid %d\n",
!  						pgrp, ppid);
  				fprintf(stderr, "%s: daemon not started.\n", progname);
  				die(1, "capability error during startup");