OSSP CVS Repository

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

Check-in Number: 3815
Date: 2002-Dec-03 12:54:03 (local)
2002-Dec-03 11:54:03 (UTC)
User:ms
Branch:
Comment: Bug fix pointer derefernce in GUID generator, and improve more portable build configuration network header file handling.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_uuid.cpp      1.1 -> 1.2     33 inserted, 8 deleted
ossp-pkg/as/as-gui/configure.in      1.9 -> 1.10     1 inserted, 3 deleted

ossp-pkg/as/as-gui/as_uuid.cpp 1.1 -> 1.2

--- as_uuid.cpp  2002/12/03 10:01:56     1.1
+++ as_uuid.cpp  2002/12/03 11:54:03     1.2
@@ -7,22 +7,47 @@
  * Library General Public License.
  */
 
+#include <stdio.h>
+#include <string.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
 
 #include "as_uuidgen.h"
 
-#ifndef max
-    /* Define a general use max macro */
-    #define max(a,b) ((a) > (b) ? (a) : (b))
+/* Include whatever autoconf found */
+#ifdef HAVE_CONFIG_H
+#include "ac_config.h"
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
 #endif
 
+#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif /* HAVE_SYS_SOCKIO_H */
 #ifdef HAVE_NET_IF_H
-    #include <net/if.h> /* For use in get_node_id() */
+#include <net/if.h>
+#endif /* HAVE_NET_IF_H */
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif /* HAVE_NETINET_IN_H */
 
-    /* Define the size of a interface address */
-    #define ifreq_size(i) max(sizeof(struct ifreq), sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
-#endif
+#ifndef max
+/* Define a general use max macro */
+#define max(a,b) ((a) > (b) ? (a) : (b))
+#endif /* max */
+
+#ifdef HAVE_NET_IF_H
+/* Define the size of a interface address */
+#define ifreq_size(i) max(sizeof(struct ifreq), sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
+#endif /* HAVE_NET_IF_H */
 
 
 static int get_random_fd(void)
@@ -104,7 +129,7 @@
         return -1;
     }
     n = ifc.ifc_len;
-    for (i = 0; i < n; i+= ifreq_size(*ifr) ) {
+    for (i = 0; i < n; i+= ifreq_size(ifr)) {
         ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
         strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ);
 #ifdef HAVE_SIOCGIFHWADDR


ossp-pkg/as/as-gui/configure.in 1.9 -> 1.10

--- configure.in 2002/12/03 10:48:25     1.9
+++ configure.in 2002/12/03 11:54:03     1.10
@@ -54,9 +54,7 @@
 dnl Checks header requirements
 AC_HEADER_STDC
 AC_HEADER_TIME
-AC_CHECK_HEADER(net/if.h,,,
-[#include <sys/types.h>
-#include <sys/socket.h>])
+AC_CHECK_HEADERS(net/if.h netinet/in.h)
 
 dnl Portable thread conf from acx_pthread.m4 autoconf macro
 ACX_PTHREAD

CVSTrac 2.0.1