[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KDE does not start on FreeBSD
From:       Bradley T Hughes <bhughes () trolltech ! com>
Date:       2002-01-09 11:08:54
[Download RAW message or body]

On Wednesday 09 January 2002 09:05, Lauri Watts wrote:

After much trial and many unanswered questions, I have a patch to make 
KDE3 work on FreeBSD:

The reason things quit working is because nothing could communicate to the 
dcop server correctly.  When ICE bound the listening socket in 
/tmp/.ICE-unix, the last char of the filename got chopped off (because the 
len parameters in the sockaddr and sockaddr_un's were all wrong).  Now, 
the thing *I* would like to know is this: why the hell did this work on 
other systems?

---------------- cut here -------------------------------------------------
Index: dcopclient.cpp
===================================================================
RCS file: /home/kde/kdelibs/dcop/dcopclient.cpp,v
retrieving revision 1.137
diff -u -b -r1.137 dcopclient.cpp
--- dcopclient.cpp      2002/01/07 05:34:01     1.137
+++ dcopclient.cpp      2002/01/09 11:04:55
@@ -34,6 +34,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
+#include <sys/socket.h>

 #include <ctype.h>
 #include <unistd.h>
@@ -352,7 +353,7 @@
  */
 void DCOPProcessInternal( DCOPClientPrivate *d, int opcode, CARD32 key, 
const QByteArray& dataReceived, bool canPost  )
 {
-    if (!d->accept_calls && (opcode == DCOPFind))
+    if (!d->accept_calls && (opcode != DCOPCall))
         return;

     IceConn iceConn = d->iceConn;
Index: KDE-ICE/Xtranssock.c
===================================================================
RCS file: /home/kde/kdelibs/dcop/KDE-ICE/Xtranssock.c,v
retrieving revision 1.5
diff -u -b -r1.5 Xtranssock.c
--- KDE-ICE/Xtranssock.c        2001/05/14 06:32:16     1.5
+++ KDE-ICE/Xtranssock.c        2002/01/09 11:04:56
@@ -936,9 +936,13 @@
        sprintf (sockname.sun_path, "%s%d", UNIX_PATH, getpid());
     }

-#if defined(BSD44SOCKETS) && !defined(Lynx)
+#if defined(BSD44SOCKETS) && !defined(Lynx) && !defined(__FreeBSD__)
     sockname.sun_len = strlen(sockname.sun_path);
     namelen = SUN_LEN(&sockname);
+#elif defined(__FreeBSD__)
+    namelen = sizeof( sockname ) - sizeof( sockname.sun_path ) +
+             strlen( sockname.sun_path );
+    sockname.sun_len = namelen;
 #else
     namelen = strlen(sockname.sun_path) + sizeof(sockname.sun_family);
 #endif
@@ -1563,9 +1567,13 @@
        return TRANS_CONNECT_FAILED;
     }

-#if defined(BSD44SOCKETS) && !defined(Lynx)
+#if defined(BSD44SOCKETS) && !defined(Lynx) && !defined(__FreeBSD__)
     sockname.sun_len = strlen (sockname.sun_path);
     namelen = SUN_LEN (&sockname);
+#elif defined(__FreeBSD__)
+    namelen = sizeof( sockname ) - sizeof( sockname.sun_path ) +
+             strlen( sockname.sun_path );
+    sockname.sun_len = namelen;
 #else
     namelen = strlen (sockname.sun_path) + sizeof (sockname.sun_family);
 #endif
---------------- cut here -------------------------------------------------

> On Wednesday 09 January 2002 01.15, Waldo Bastian wrote:
> > Interesting.. I think I found a bug. But the fact that it gets
> > triggered means that there is something else wrong as well.
> >
> > This time a patch for dcopclient.cpp (it should go on top of the other
> > patch).. can you send me the output of "testdcop" as well?
>
> It is testdcop I've been sending you, the machine is remote (ok, it's in
> my basement, and I got tired of running up and down stairs to try
> restart KDE.) The errors are the same though, as when I'm sitting in
> front of it.
>
> This time I captured a (failed) kde startup on the machine itself,
> attached as x_output, and the results from testdcop, attached as
> testdcop_dcopclient
>
> Perhaps irrelevant, but I get some warnings in the compiling:
>
> /cvs/kdelibs/dcop/KDE-ICE/process.c: In function
> `ProcessConnectionSetup': /cvs/kdelibs/dcop/KDE-ICE/process.c:945:
> warning: assignment discards qualifiers from pointer target type
> /cvs/kdelibs/dcop/KDE-ICE/process.c: In function `ProcessProtocolSetup':
> /cvs/kdelibs/dcop/KDE-ICE/process.c:1977: warning: passing arg 4 of
> `_KDE_IceGetPaValidAuthIndices' from incompatible pointer type
>
> and
>
> /cvs/kdelibs/dcop/KDE-ICE/Xtrans.c: In function
> `_KDE_IceTransParseAddress': /cvs/kdelibs/dcop/KDE-ICE/Xtrans.c:230:
> warning: assignment makes pointer from integer without a cast
> /cvs/kdelibs/dcop/KDE-ICE/Xtrans.c:281: warning: assignment makes
> pointer from integer without a cast

-- 
--
Bradley T. Hughes - bhughes at trolltech.com
Trolltech AS - Waldemar Thranes gt. 98 N-0175 Oslo, Norway

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic