INN commit: trunk (5 files)

INN Commit Russ_Allbery at isc.org
Sat Jan 31 08:30:38 UTC 2009


    Date: Saturday, January 31, 2009 @ 00:30:38
  Author: iulius
Revision: 8307

Fix compilation issues when Unix domain sockets do not exist.

Modified:
  trunk/innd/cc.c
  trunk/innd/lc.c
  trunk/innd/rc.c
  trunk/lib/inndcomm.c
  trunk/lib/localopen.c

-----------------+
 innd/cc.c       |   13 ++++++++-----
 innd/lc.c       |    2 +-
 innd/rc.c       |    2 +-
 lib/inndcomm.c  |    2 ++
 lib/localopen.c |    2 +-
 5 files changed, 13 insertions(+), 8 deletions(-)

Modified: innd/cc.c
===================================================================
--- innd/cc.c	2009-01-30 20:03:11 UTC (rev 8306)
+++ innd/cc.c	2009-01-31 08:30:38 UTC (rev 8307)
@@ -83,7 +83,9 @@
 static char		CCnotrunning[] = "1 Must be running";
 static struct buffer	CCreply;
 static CHANNEL		*CCchan;
+#ifdef HAVE_UNIX_DOMAIN_SOCKETS
 static int		CCwriter;
+#endif
 static CCDISPATCH	CCcommands[] = {
     {	SC_ADDHIST,	5, CCaddhist	},
     {	SC_ALLOW,	1, CCallow	},
@@ -1732,15 +1734,15 @@
 static void
 CCreader(CHANNEL *cp)
 {
-    static char		TOOLONG[] = "0 Reply too long for server to send";
     CCDISPATCH		*dp;
     const char *	p;
     ICC_MSGLENTYPE	bufflen;
     ICC_PROTOCOLTYPE	protocol ;
 #if	defined(HAVE_UNIX_DOMAIN_SOCKETS)
-    struct sockaddr_un	client;
+    static char         TOOLONG[] = "0 Reply too long for server to send";
+    struct sockaddr_un  client;
 #else
-    int			written;
+    int                 written;
 #endif	/* defined(HAVE_UNIX_DOMAIN_SOCKETS) */
     int			i;
     char                buff[BIG_BUFFER + 2];
@@ -1909,11 +1911,12 @@
     if ((i = open(argv[0], O_WRONLY | O_NDELAY)) < 0)
 	syslog(L_ERROR, "%s cant open %s %m", LogName, argv[0]);
     else {
-	if ((written = write(i, tbuff, len)) != len)
+	if ((written = write(i, tbuff, len)) != len) {
 	    if (written < 0)
 		syslog(L_ERROR, "%s cant write %s %m", LogName, argv[0]);
-	    else
+            else
 		syslog(L_ERROR, "%s cant write %s", LogName, argv[0]);
+        }
 	if (close(i) < 0)
 	    syslog(L_ERROR, "%s cant close %s %m", LogName, argv[0]);
     }

Modified: innd/lc.c
===================================================================
--- innd/lc.c	2009-01-30 20:03:11 UTC (rev 8306)
+++ innd/lc.c	2009-01-31 08:30:38 UTC (rev 8307)
@@ -13,7 +13,7 @@
 #include "innd.h"
 
 
-#if HAVE_UNIX_DOMAIN_SOCKETS
+#ifdef HAVE_UNIX_DOMAIN_SOCKETS
 # include <sys/un.h>
 
 static char	*LCpath = NULL;

Modified: innd/rc.c
===================================================================
--- innd/rc.c	2009-01-30 20:03:11 UTC (rev 8306)
+++ innd/rc.c	2009-01-31 08:30:38 UTC (rev 8307)
@@ -850,7 +850,7 @@
     hints.ai_flags = AI_NUMERICHOST;
     ret = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
     if (ret != 0)
-        die("%s cant getaddrinfo 127.0.0.1: %s", gai_strerror(ret));
+        die("%s cant getaddrinfo 127.0.0.1: %s", LogName, gai_strerror(ret));
     memcpy(&rp->Address, ai->ai_addr, ai->ai_addrlen);
     freeaddrinfo(ai);
     rp->Name = xstrdup("localhost");

Modified: lib/inndcomm.c
===================================================================
--- lib/inndcomm.c	2009-01-30 20:03:11 UTC (rev 8306)
+++ lib/inndcomm.c	2009-01-31 08:30:38 UTC (rev 8307)
@@ -54,7 +54,9 @@
 ICCopen(void)
 {
     int mask, oerrno, fd;
+#ifdef HAVE_UNIX_DOMAIN_SOCKETS
     int size = 65535;
+#endif
 
     if (innconf == NULL) {
 	if (!innconf_read(NULL)) {

Modified: lib/localopen.c
===================================================================
--- lib/localopen.c	2009-01-30 20:03:11 UTC (rev 8306)
+++ lib/localopen.c	2009-01-31 08:30:38 UTC (rev 8307)
@@ -12,7 +12,7 @@
 #include "nntp.h"
 #include "inn/paths.h"
 
-#if HAVE_UNIX_DOMAIN_SOCKETS
+#ifdef HAVE_UNIX_DOMAIN_SOCKETS
 # include <sys/un.h>
 #endif
 




More information about the inn-committers mailing list