Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 89345

Summary: sys-apps/netkit-base-0.17-r8 gcc4 patch
Product: Gentoo Linux Reporter: Marcelo Goes (RETIRED) <vanquirius>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
URL: http://debian-ppc64.alioth.debian.org/gcc4/patches/netkit-base_0.10-10.0.0.1.gcc4.patch
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: netkit-base-0.17-gcc4.diff

Description Marcelo Goes (RETIRED) gentoo-dev 2005-04-16 13:06:57 UTC
Hi there,
I'm attaching a patch based on a patch from Debian that allows gcc-4 compilation.

Also, I would like to report a file collision:

* checking 29 files for package collisions
existing file /usr/share/man/man3/daemon.3.gz is not owned by this package

$ qpkg -f /usr/share/man/man3/daemon.3.gz
sys-apps/man-pages *
Comment 1 Marcelo Goes (RETIRED) gentoo-dev 2005-04-16 13:08:36 UTC
Created attachment 56472 [details, diff]
netkit-base-0.17-gcc4.diff

Just add
epatch ${FILESDIR}/${P}-gcc4.diff
to src_unpack().
Comment 2 SpanKY gentoo-dev 2005-04-16 22:39:10 UTC
ive fixed the manpage install ... that patch looks funky, is it ok ?
Comment 3 Marcelo Goes (RETIRED) gentoo-dev 2005-04-17 07:08:52 UTC
It is ok as in "it works".

It makes sense to me since there should be no need to use (type)a = (type)x when assigning a value, just a = (type)x should work. But this is in the wire fields of gcc-4...
Comment 4 SpanKY gentoo-dev 2005-04-18 18:07:47 UTC
yes, but if you do something like
char blah[4];
(*int)blah[0] = 40303;

that acts differently from say
char blah[4];
blah[0] = 40303;

so if all the swap() usage in netkit-base is pointer clean, the change should be fine
Comment 5 Marcelo Goes (RETIRED) gentoo-dev 2005-04-18 18:59:15 UTC
Well then, if understand you correctly the following will yield messed up results?

if (cp->se_user)
	SWAP(char *, sep->se_user, cp->se_user);

If so, I agree it is wiser to reject the patch.
Comment 6 Marcelo Goes (RETIRED) gentoo-dev 2005-04-18 19:24:09 UTC
To make it easier, the code:

#define SWAP(type, a, b) {type c=(type)a; a=(type)b; b=(type)c;}

		/*
		 * sep->se_wait may be holding the pid of a daemon
		 * that we're waiting for.  If so, don't overwrite
		 * it unless the config file explicitly says don't 
		 * wait.
		 */
		if (cp->se_bi == 0 && (sep->se_wait == 1 || cp->se_wait == 0))
			sep->se_wait = cp->se_wait;
		if (cp->se_max != sep->se_max)
			SWAP(int, cp->se_max, sep->se_max);
		if (cp->se_user)
			SWAP(char *, sep->se_user, cp->se_user);
		if (cp->se_group)
			SWAP(char *, sep->se_group, cp->se_group);
		if (cp->se_server)
			SWAP(char *, sep->se_server, cp->se_server);
		if (cp->se_address) {
			/* must swap se_service; se_address points into it */
			SWAP(char *, sep->se_service, cp->se_service);
			SWAP(char *, sep->se_address, cp->se_address);
		}
		for (i = 0; i < MAXARGV; i++)
			SWAP(char *, sep->se_argv[i], cp->se_argv[i]);
#undef SWAP
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2005-04-29 03:45:39 UTC
The pointer arith is fine (just swaps info between two struct's of the same type).
Added to cvs, thanks.