guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-15-81-g48


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-15-81-g482d311
Date: Sun, 13 Feb 2011 21:05:31 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=482d311b3945a2b7133888b18f1fd18e472f8ce8

The branch, master has been updated
       via  482d311b3945a2b7133888b18f1fd18e472f8ce8 (commit)
       via  e8ab529d57e2c3820e567737bd53c6e05e484c4d (commit)
      from  333a81ccbadc7a81abec1aff4b5981b9fad3786b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 482d311b3945a2b7133888b18f1fd18e472f8ce8
Author: Noah Lavine <address@hidden>
Date:   Sun Feb 13 15:31:32 2011 -0500

    Set sockaddr_in.sin_len field when it exists.
    
    * configure.ac: Detect when struct sockaddr_in has a sin_len field.
      Remove obsolete comment.
    * libguile/socket.c (scm_to_sockaddr, scm_fill_sockaddr): Set the
      sin_len field in our struct sockaddr_in when it exists.

commit e8ab529d57e2c3820e567737bd53c6e05e484c4d
Author: Andy Wingo <address@hidden>
Date:   Sun Feb 13 22:02:01 2011 +0100

    bump objcode version to 2.0; introduce minor-version compatibility
    
    * libguile/_scm.h (SCM_OBJCODE_MAJOR_VERSION): Bump to 2.
      (SCM_OBJCODE_MINOR_VERSION): Reset to 0.
      (SCM_OBJCODE_MACHINE_VERSION_STRING, SCM_OBJCODE_COOKIE): Reorder so
      the minor version is the last byte.
    
    * libguile/objcodes.c (make_objcode_by_mmap): Accept objcodes whose
      minor version is less than SCM_OBJCODE_MINOR_VERSION, not just equal
      to.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac        |    5 +----
 libguile/_scm.h     |   10 +++++-----
 libguile/objcodes.c |   18 +++++++++++++++++-
 libguile/socket.c   |    6 +++++-
 4 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index fd50672..5b47701 100644
--- a/configure.ac
+++ b/configure.ac
@@ -957,10 +957,7 @@ AC_CHECK_FUNCS(sethostent   gethostent   endhostent   dnl
                getnetbyaddr getnetbyname dnl
               inet_lnaof inet_makeaddr inet_netof hstrerror)
 
-# struct sockaddr field sin_len is only present on BSD systems.
-# On 4.4BSD apparently a #define SIN_LEN exists, but on other BSD systems
-# (eg. FreeBSD 4.9) it doesn't and we must use this configure check
-AC_CHECK_MEMBERS([struct sockaddr.sin_len],,,
+AC_CHECK_MEMBERS([struct sockaddr_in.sin_len],,,
 [#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
diff --git a/libguile/_scm.h b/libguile/_scm.h
index 5421116..2842130 100644
--- a/libguile/_scm.h
+++ b/libguile/_scm.h
@@ -3,7 +3,7 @@
 #ifndef SCM__SCM_H
 #define SCM__SCM_H
 
-/* Copyright (C) 1995,1996,2000,2001, 2002, 2006, 2008, 2009, 2010 Free 
Software Foundation, Inc.
+/* Copyright (C) 1995,1996,2000,2001, 2002, 2006, 2008, 2009, 2010, 2011 Free 
Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -205,8 +205,8 @@
 #define SCM_OBJCODE_WORD_SIZE  SCM_CPP_STRINGIFY (SIZEOF_VOID_P)
 
 /* Major and minor versions must be single characters. */
-#define SCM_OBJCODE_MAJOR_VERSION 0
-#define SCM_OBJCODE_MINOR_VERSION T
+#define SCM_OBJCODE_MAJOR_VERSION 2
+#define SCM_OBJCODE_MINOR_VERSION 0
 #define SCM_OBJCODE_MAJOR_VERSION_STRING        \
   SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION)
 #define SCM_OBJCODE_MINOR_VERSION_STRING        \
@@ -214,11 +214,11 @@
 #define SCM_OBJCODE_VERSION_STRING                                      \
   SCM_OBJCODE_MAJOR_VERSION_STRING "." SCM_OBJCODE_MINOR_VERSION_STRING
 #define SCM_OBJCODE_MACHINE_VERSION_STRING                              \
-  SCM_OBJCODE_VERSION_STRING "-" SCM_OBJCODE_ENDIANNESS "-" 
SCM_OBJCODE_WORD_SIZE
+  SCM_OBJCODE_ENDIANNESS "-" SCM_OBJCODE_WORD_SIZE "-" 
SCM_OBJCODE_VERSION_STRING
 
 /* The objcode magic header.  */
 #define SCM_OBJCODE_COOKIE                              \
-  "GOOF-" SCM_OBJCODE_MACHINE_VERSION_STRING "---"
+  "GOOF----" SCM_OBJCODE_MACHINE_VERSION_STRING
 
 #endif  /* SCM__SCM_H */
 
diff --git a/libguile/objcodes.c b/libguile/objcodes.c
index b7aa578..f4e20f8 100644
--- a/libguile/objcodes.c
+++ b/libguile/objcodes.c
@@ -77,7 +77,13 @@ make_objcode_by_mmap (int fd)
       SCM_SYSERROR;
     }
 
-  if (memcmp (addr, SCM_OBJCODE_COOKIE, strlen (SCM_OBJCODE_COOKIE)))
+  /* The cookie ends with a version of the form M.N, where M is the
+     major version and N is the minor version.  For this Guile to be
+     able to load an objcode, M must be SCM_OBJCODE_MAJOR_VERSION, and N
+     must be less than or equal to SCM_OBJCODE_MINOR_VERSION.  Since N
+     is the last character, we do a strict comparison on all but the
+     last, then a <= on the last one.  */
+  if (memcmp (addr, SCM_OBJCODE_COOKIE, strlen (SCM_OBJCODE_COOKIE) - 1))
     {
       SCM args = scm_list_1 (scm_from_latin1_stringn
                              (addr, strlen (SCM_OBJCODE_COOKIE)));
@@ -86,6 +92,16 @@ make_objcode_by_mmap (int fd)
       scm_misc_error (FUNC_NAME, "bad header on object file: ~s", args);
     }
 
+  {
+    char minor_version = addr[strlen (SCM_OBJCODE_COOKIE) - 1];
+
+    if (minor_version > SCM_OBJCODE_MINOR_VERSION_STRING[0])
+      scm_misc_error (FUNC_NAME, "objcode minor version too new (~a > ~a)",
+                      scm_list_2 (scm_from_latin1_stringn (&minor_version, 1),
+                                  scm_from_latin1_string
+                                  (SCM_OBJCODE_MINOR_VERSION_STRING)));
+  }
+
   data = (struct scm_objcode*)(addr + strlen (SCM_OBJCODE_COOKIE));
 
   if (data->len + data->metalen != (st.st_size - sizeof (*data) - strlen 
(SCM_OBJCODE_COOKIE)))
diff --git a/libguile/socket.c b/libguile/socket.c
index d8ab005..1059708 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -798,7 +798,7 @@ scm_fill_sockaddr (int fam, SCM address, SCM *args, int 
which_arg,
        soka = (struct sockaddr_in *) scm_malloc (sizeof (struct sockaddr_in));
         memset (soka, '\0', sizeof (struct sockaddr_in));
 
-#ifdef HAVE_STRUCT_SOCKADDR_SIN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
        soka->sin_len = sizeof (struct sockaddr_in);
 #endif
        soka->sin_family = AF_INET;
@@ -1134,6 +1134,10 @@ scm_to_sockaddr (SCM address, size_t *address_size)
 
             memset (&c_inet, '\0', sizeof (struct sockaddr_in));
 
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+            c_inet.sin_len = sizeof (struct sockaddr_in);
+#endif
+
            c_inet.sin_addr.s_addr =
              htonl (scm_to_ulong (SCM_SIMPLE_VECTOR_REF (address, 1)));
            c_inet.sin_port =


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]