[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFC: moreutils



Hi,

moreutils FTBFS because of Linux-specific stuff in ifdata.c; after
tweaking the headers a bit, the situation is a bit better, but still
needs work:
| cc -O2 -g -Wall    ifdata.c   -o ifdata
| ifdata.c: In function 'if_flags':
| ifdata.c:140: error: 'IFF_NOTRAILERS' undeclared (first use in this function)
| ifdata.c:140: error: (Each undeclared identifier is reported only once
| ifdata.c:140: error: for each function it appears in.)
| ifdata.c:145: error: 'IFF_MASTER' undeclared (first use in this function)
| ifdata.c:146: error: 'IFF_SLAVE' undeclared (first use in this function)
| ifdata.c:148: error: 'IFF_PORTSEL' undeclared (first use in this function)
| ifdata.c:149: error: 'IFF_AUTOMEDIA' undeclared (first use in this function)
| ifdata.c:150: error: 'IFF_DYNAMIC' undeclared (first use in this function)
| ifdata.c: In function 'if_hwaddr':
| ifdata.c:167: error: 'SIOCGIFHWADDR' undeclared (first use in this function)
| ifdata.c:167: warning: passing argument 2 of 'do_socket_ioctl' makes integer from pointer without a cast
| ifdata.c:170: error: 'struct ifreq' has no member named 'ifr_hwaddr'
| ifdata.c:170: error: request for member 'sa_data' in something not a structure or union
| make: *** [ifdata] Error 1

I'm not sure whether we really should bother porting it right now, we
could just ask Joey to only build it on Linux, don't you think?

Also, another issue: WEXITED isn't available on GNU/kFreeBSD. I've
emulated it the following way, and “parallel” seems to work fine on some
trivial examples. Some extra eyes are welcome, though.
| commit f2693749ab86c67a1d90de28831e062ebe76d897
| Author: Cyril Brulebois <kibi@debian.org>
| Date:   Sat Jul 11 16:23:12 2009 +0200
| 
|     Emulate waitid(..., WEXITED) where WEXITED isn't defined.
| 
| diff --git a/parallel.c b/parallel.c
| index 8045e22..82dada9 100644
| --- a/parallel.c
| +++ b/parallel.c
| @@ -69,7 +69,14 @@ int wait_for_child(int options) {
|  	siginfo_t infop;
|  
|  	infop.si_pid = 0;
| +#ifdef WEXITED
|  	waitid(P_ALL, id_ignored, &infop, WEXITED | options);
| +#else
| +	/* Emulate where WEXITED isn't defined, e.g. GNU/kFreeBSD */
| +	do {
| +		waitid(P_ALL, id_ignored, &infop, options);
| +	} while (! WIFEXITED(infop.si_status));
| +#endif
|  	if (infop.si_pid == 0)
|  		return -1; /* Nothing to wait for */
|  	if (infop.si_code == CLD_EXITED)

Mraw,
KiBi.


Reply to: