OSSP CVS Repository

ossp - Check-in [697]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 697
Date: 2001-Aug-20 13:28:29 (local)
2001-Aug-20 11:28:29 (UTC)
User:rse
Branch:
Comment: Autoconf phase 4
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/.configure      1.1 -> 1.2     1 inserted, 2 deleted
ossp-pkg/lmtp2nntp/.cvsignore      1.5 -> 1.6     2 inserted, 0 deleted
ossp-pkg/lmtp2nntp/autogen.sh      1.2 -> 1.3     1 inserted, 1 deleted
ossp-pkg/lmtp2nntp/configure.ac      1.3 -> 1.4     4 inserted, 0 deleted
ossp-pkg/lmtp2nntp/sa.c      1.2 -> 1.3     36 inserted, 0 deleted
ossp-pkg/lmtp2nntp/trace.c      1.1 -> 1.2     17 inserted, 4 deleted
ossp-pkg/lmtp2nntp/trace.h      1.1 -> 1.2     0 inserted, 2 deleted

ossp-pkg/lmtp2nntp/.configure 1.1 -> 1.2

--- .configure   2001/08/20 10:50:07     1.1
+++ .configure   2001/08/20 11:28:29     1.2
@@ -1,5 +1,4 @@
 #!/bin/sh
 ./configure \
    --prefix=/tmp/lmtp2nntp \
-   --with-str=/cw \
-   --enable-debug
+   --with-str=/cw


ossp-pkg/lmtp2nntp/.cvsignore 1.5 -> 1.6

--- .cvsignore   2001/08/20 10:33:43     1.5
+++ .cvsignore   2001/08/20 11:28:29     1.6
@@ -3,6 +3,8 @@
 configure
 config.status
 config.log
+config.h
+config.h.in
 lmtp2nntp
 lmtp2nntp.1
 lmtp2nntp-*.tar.gz


ossp-pkg/lmtp2nntp/autogen.sh 1.2 -> 1.3

--- autogen.sh   2001/08/20 10:33:22     1.2
+++ autogen.sh   2001/08/20 11:28:29     1.3
@@ -35,7 +35,7 @@
 #   GNU Autoconf generation
 echo "GNU Autoconf $autoconf_version -> configure, config.h.in"
 autoconf
-#autoheader
+autoheader
 
 #   GNU Shtool generation
 echo "GNU Shtool $shtoolize_version -> shtool"


ossp-pkg/lmtp2nntp/configure.ac 1.3 -> 1.4

--- configure.ac 2001/08/20 10:45:44     1.3
+++ configure.ac 2001/08/20 11:28:29     1.4
@@ -18,8 +18,12 @@
 AC_PROG_CPP
 AC_CHECK_DEBUGGING
 AC_CHECK_EXTLIB([Generic String Library], str, str_parse, str.h, :, echo "REQUIRE STR!"; exit 1)
+AC_CHECK_LIB(socket, getprotobyname)
+AC_CHECK_LIB(nsl, gethostbyname)
+AC_CHECK_FUNCS(inet_pton inet_aton)
 
 dnl #   standard output generation
+AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_FILES(Makefile:Makefile.in)
 AC_OUTPUT
 


ossp-pkg/lmtp2nntp/sa.c 1.2 -> 1.3

--- sa.c 2001/08/12 13:44:10     1.2
+++ sa.c 2001/08/20 11:28:29     1.3
@@ -42,8 +42,34 @@
 #include <sys/socket.h>
 #include <arpa/inet.h>
 
+#include "config.h"
 #include "sa.h"
 
+#if !defined(AF_LOCAL) && defined(AF_UNIX)
+#define AF_LOCAL AF_UNIX
+#endif
+
+#ifndef HAVE_INET_PTON
+#ifdef HAVE_INET_ATON
+static int inet_pton(int family, const char *strptr, void *addrptr)
+{
+    struct in_addr in_val;
+
+    if (family == AF_INET) {
+        if (inet_aton(strptr, &in_val)) {
+            memcpy(addrptr, &in_val, sizeof(struct in_addr));
+            return 1;
+        }
+        return 0;
+    }
+    errno = EAFNOSUPPORT;
+    return -1;
+}
+#else
+#error "neither inet_pton nor inet_aton available"
+#endif
+#endif
+
 sa_t *sa_create(int sa_type, ...)
 {
     va_list ap;
@@ -52,7 +78,9 @@
     socklen_t sl;
     struct sockaddr *sa;
     struct sockaddr_in sa4;
+#ifdef AF_INET6
     struct sockaddr_in6 sa6;
+#endif
     struct sockaddr_un sau;
     struct hostent *he;
     struct servent *se;
@@ -70,6 +98,7 @@
     sa = NULL;
     sl = 0;
     if (sa_type == SA_UNIX) {
+#if defined(AF_LOCAL)
         if ((cpPath = va_arg(ap, char *)) == NULL)
             return NULL;
         if ((nPath = strlen(cpPath)) >= (sizeof(sau.sun_path)-1))
@@ -79,6 +108,9 @@
         memcpy(sau.sun_path, cpPath, nPath + 1);
         sa = (struct sockaddr *)&sau;
         sl = sizeof(sau);
+#else
+        return NULL;
+#endif
     }
     else if (sa_type == SA_IP) {
         if ((cpProto = va_arg(ap, char *)) == NULL)
@@ -116,12 +148,14 @@
             sa = (struct sockaddr *)&sa4;
             sl = sizeof(sa4);
         }
+#ifdef AF_INET6
         else if (inet_pton(AF_INET6, cpHost, &sa6.sin6_addr.s6_addr) == 1) {
             sa6.sin6_family = AF_INET6;
             sa6.sin6_port = htons(nPort);
             sa = (struct sockaddr *)&sa6;
             sl = sizeof(sa6);
         }
+#endif
         else if ((he = gethostbyname(cpHost)) != NULL) {
             if (he->h_addrtype == AF_INET) {
                 sa4.sin_family = AF_INET;
@@ -130,6 +164,7 @@
                 sa = (struct sockaddr *)&sa4;
                 sl = sizeof(sa4);
             }
+#ifdef AF_INET6
             else if (he->h_addrtype == AF_INET6) {
                 sa6.sin6_family = AF_INET6;
                 sa6.sin6_port = htons(nPort);
@@ -137,6 +172,7 @@
                 sa = (struct sockaddr *)&sa6;
                 sl = sizeof(sa6);
             }
+#endif
         }
     }
     else


ossp-pkg/lmtp2nntp/trace.c 1.1 -> 1.2

--- trace.c      2001/08/14 08:15:26     1.1
+++ trace.c      2001/08/20 11:28:30     1.2
@@ -1,6 +1,19 @@
 
+#include <errno.h>
+#include <limits.h>
+
 #include "trace.h"
 
+#ifndef _POSIX_PATH_MAX
+#if defined(PATH_MAX)
+#define _POSIX_PATH_MAX PATH_MAX
+#elif defined(MAX_PATH)
+#define _POSIX_PATH_MAX MAX_PATH
+#else
+#error "unable to determime maximum path limit"
+#endif
+#endif
+
 /*
  * tracing
  */
@@ -9,10 +22,10 @@
 {
     ssize_t rc;
     int tf;
-    static char tfn[PATH_MAX] = "/tmp/trace";
+    static char tfn[_POSIX_PATH_MAX] = "/tmp/trace";
 
     if ((d == -1) && (buf != NULL) && (nbytes == 0)) {
-        strncpy(tfn, buf, PATH_MAX-1);
+        strncpy(tfn, buf, _POSIX_PATH_MAX-1);
     }
     rc = read(d, buf, nbytes);
     if ((tf = open(tfn, O_CREAT|O_WRONLY|O_APPEND, 0664)) != -1) {
@@ -26,10 +39,10 @@
 {
     ssize_t rc;
     int tf;
-    static char tfn[PATH_MAX] = "/tmp/trace";
+    static char tfn[_POSIX_PATH_MAX] = "/tmp/trace";
 
     if ((d == -1) && (buf != NULL) && (nbytes == 0)) {
-        strncpy(tfn, buf, PATH_MAX-1);
+        strncpy(tfn, buf, _POSIX_PATH_MAX-1);
     }
 
     rc = write(d, buf, nbytes);


ossp-pkg/lmtp2nntp/trace.h 1.1 -> 1.2

--- trace.h      2001/08/14 08:15:26     1.1
+++ trace.h      2001/08/20 11:28:30     1.2
@@ -5,10 +5,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
-#include <errno.h>
 #include <string.h>
 #include <fcntl.h>
-#include <sys/syslimits.h>
 
 ssize_t trace_read (int,       void *, size_t);
 ssize_t trace_write(int, const void *, size_t);

CVSTrac 2.0.1