Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: Fabien Steinmetz To: cygwin AT cygwin DOT com Subject: Re: dansguardian/cygwin and IPC/BSD sockets. Doesn't write to log (solved) Date: Sun, 13 Mar 2005 17:09:40 +0100 User-Agent: KMail/1.7.1 References: <200503131211 DOT 18527 DOT fabienst AT yahoo DOT fr> In-Reply-To: <200503131211.18527.fabienst@yahoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Message-Id: <200503131709.41023.fabienst@yahoo.fr> X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j2DGA04U028286 I managed to solve the problem. In fact I had __BSD defined, although it shouldn't have been. Undefining it solved the problem. I apologize for habing begun that thread Fabien Le Dimanche 13 Mars 2005 12:11, Fabien Steinmetz a écrit : > Hello, > > I'm trying to make dansguardian (www.danguardian.org v.2.8.0.4) run on > Cygwin/WindowsXP. > I modified the "configure" script so that dansguardian gets compiled. > Currently everything works ok (i.e. filtering...), _except_ writing into > the log file and the url cache. > > Dansguardian uses IPC and a pipe to write to files. From what I read in > various mailing lists and forums, I understood that : > - It should be possible to use the original code of the program writen for > Linux/Posix and that cugwin would manage everything to make BSD sockets > work on windows > - Another solution would be to change the code of the program > (dansguardian) and use winsock2 instead of BSD socket. Thus having a win32 > implementation of sockets. I would like to avoid rewriting (part of) the > code. > > So as I read there still could be problems with the cygwin "implemantation" > of BSD sockets I thought it would be a good place to report my issues here. > > > Dansguardian reports the following errors (found in windows' journal) > "Error connecting via ipc to log" > "Error connecting via ipc to url cache" > > I had a look at the code of dansguardian to find where the issue comes > from. > > I found that I have an errno 14 (ie EFAULT "Bad Address") in the following > function of file "UDSocket.cpp". This occurs after calling 'connect > > ======= EXTRACT OF FILE "UDSocket.cpp" ========== > int UDSocket::connect(const char* path) { // to make a connection to a > serv #ifdef DGDEBUG > std::cout << "uds connect:" << path << std::endl; > #endif > isused = true; > strcpy(my_adr_un.sun_path, path); > #ifdef __BSD > // __BSD IS NOT DEFINED IN MY CONFIG. SHOULD IT BE DEFINED ? > #ifdef SCM_RIGHTS /* 4.3BSD Reno and later */ > my_adr_un_length = sizeof(my_adr_un.sun_len) + > sizeof(my_adr_un.sun_family) + strlen(my_adr_un.sun_path) + 1; > my_adr_un.sun_len = my_adr_un_length ; > #endif > #else > my_adr_un_length = sizeof(my_adr_un.sun_family) + > strlen(my_adr_un.sun_path); > #endif > int ret_value = ::connect(sck_un, (struct sockaddr *) &my_adr_un, > my_adr_un_length); > //HERE I HAVE ERRNO 14 ! > //std::cout << "connect ret value:" << ret_value << std::endl; > //std::cout << "connect ret value errno:" << errno << std::endl; > > return ret_value; > } > ======= EXTRACT OF FILE "UDSocket.cpp" ========== > > The output of function above is : > uds connect:/tmp/.dguardianipc > connect ret value:-1 > connect ret value errno:14 > > > Any idea on why I have errno 14 and how to solve it ? > > > My Config : > - Cygwin 1.5.13-1 on windows XP (home or pro) > - Squid NT 2.5.stable9 > (http://www.acmeconsulting.it/pagine/opensource/squid/squidnt25.htm) > - The filesystem is NTFS and /tmp has the good permissions (1777) > > > Thanks for your help. > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/