acpid-1.0.4 compilation fix for GCC-4.0.3

julio28 at jumec.jazztel.es julio28 at jumec.jazztel.es
Tue Apr 25 16:53:52 PDT 2006


Hi,

first of all, sorry for my way of announcing this, as I'm not sure if this has 
passed inadverted to you or you're currently working to fix this... let me put 
you in a little bit of story for you to know how I found a solution...

you have to take into account I'm using the readings on BLFS SVN...

I was trying to compile acpid-1.0.4 for HAL-0.5.7 to be able to process ACPI 
events, but when I just type *make* and press enter this is the result I 
obtained:

particlehunter at mobilebox [acpid-1.0.4] make
cc -Wall -Werror -g -DVERSION="\"1.0.4\""   -c -o acpid.o acpid.c
cc -Wall -Werror -g -DVERSION="\"1.0.4\""   -c -o event.o event.c
cc -Wall -Werror -g -DVERSION="\"1.0.4\""   -c -o ud_socket.o ud_socket.c
cc1: warnings being treated as errors
ud_socket.c: In function 'ud_accept':
ud_socket.c:63: warning: pointer targets in passing argument 3 of 'accept' 
differ in signedness
ud_socket.c:74: warning: pointer targets in passing argument 5 of 'getsockopt' 
differ in signedness
make: *** [ud_socket.o] Error 1
particlehunter at mobilebox [acpid-1.0.4]

so I grabbed google and performed a search for any kind of hint or a patch, and 
I found an embedded patch in a post in Google Groups, this is the posting:

diff -urN ../tmp-orig/acpid-1.0.4/ud_socket.c ./ud_socket.c 
--- ../tmp-orig/acpid-1.0.4/ud_socket.c 2003-11-17 22:24:58.000000000 +0100 
+++ ./ud_socket.c       2005-06-20 14:14:06.000000000 +0200 
@@ -58,7 +58,7 @@ 
        while (1) { 
                int newsock = 0; 
                struct sockaddr_un cliaddr; 
-               int len = sizeof(struct sockaddr_un); 
+               socklen_t len = sizeof(struct sockaddr_un); 


                newsock = accept(listenfd, (struct sockaddr *)&cliaddr, &len); 
                if (newsock < 0) { 

after reading this, I compared what I read in this post and the content of the 
ud_socket.c file, and the only difference is what the suggested patch does, 
replace the line with [int len = sizeof(struct sockaddr_un);] with [socklen_t 
len = sizeof(struct sockaddr_un);]. After replacing this, I performed a single 
run of *make* and voila, everything compile without a hitch and I could 
continue installing HAL-0.5.7

I hope any of you could produce a patch or a sed substitution string for acpid-
1.0.4 and include it in the BLFS book, as I think it would be an ideal 
dependency for the HAL package, and in general, for the BLFS system.

Thanks in advance and sorry for any inconvenience,
Julio Maria Meca Hansen




More information about the blfs-dev mailing list