[Nickle] nickle: Branch 'master'

Keith Packard keithp at keithp.com
Thu May 10 10:23:43 PDT 2012


 builtin-sockets.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5b00e11e61e5c659c7ad49fec7d7a4a1ab53d686
Author: Keith Packard <keithp at keithp.com>
Date:   Thu May 10 10:22:55 2012 -0700

    Handle systems which don't define PATH_MAX (Hurd)
    
    This is a hack; a correct fix would involve actually allocating the
    correct length object.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/builtin-sockets.c b/builtin-sockets.c
index 9bbdbbb..df32de0 100644
--- a/builtin-sockets.c
+++ b/builtin-sockets.c
@@ -192,13 +192,19 @@ do_Socket_create (int num, Value *args)
     RETURN (ret);
 }
 
+#ifdef PATH_MAX
+#define UN_SOCK_MAX	PATH_MAX
+#else
+#define UN_SOCK_MAX	4096
+#endif
+
 typedef union {
     struct sockaddr_in in;
     struct sockaddr_un un;
     struct sockaddr addr;
     struct {
 	struct sockaddr_un un;
-	char path[PATH_MAX];
+	char path[UN_SOCK_MAX];
     } align;
 } sockaddr_all_t;
 
@@ -226,7 +232,7 @@ static Bool address_lookup_af_unix (int num, Value *args,
     if (!local_socket || *local_socket == '\0')
 	return False;
 
-    if (strlen (local_socket) > PATH_MAX)
+    if (strlen (local_socket) > UN_SOCK_MAX)
 	return False;
 
     addr->sun_family = s->file.sock_family;


More information about the Nickle mailing list