From e20576df3299c7b6a9e704857ab8cee5d46eb007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Thu, 28 Jan 2016 11:47:48 +0100 Subject: [PATCH] fix: si:open-unix-socket-stream accepts both string and base-string (automatic coercion is performed) --- CHANGELOG | 3 +++ src/c/tcp.d | 4 +++- src/cmp/proclamations.lsp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8ece1be23..4ebaacc53 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -90,6 +90,9 @@ ** Issues fixed: + - si:open-unix-socket-stream accepts both string and base-string + (automatic coercion is performed) + - Long form of DEFSETF accepts multiple-values as a store forms: (defsetf gah (x) (y z) `(list ,x ,y ,z)) diff --git a/src/c/tcp.d b/src/c/tcp.d index 7eb0774fa..ff520b7c9 100644 --- a/src/c/tcp.d +++ b/src/c/tcp.d @@ -339,9 +339,11 @@ si_open_unix_socket_stream(cl_object path) int fd; /* file descriptor */ struct sockaddr_un addr; - if (ecl_unlikely(ecl_t_of(path) != t_base_string)) + if (ecl_unlikely(!ECL_STRINGP(path))) FEwrong_type_nth_arg(@[si::open-unix-socket-stream], 1, path, @[string]); + + path = si_coerce_to_base_string(path); if (path->base_string.fillp > UNIX_MAX_PATH-1) FEerror("~S is a too long file name.", 1, path); diff --git a/src/cmp/proclamations.lsp b/src/cmp/proclamations.lsp index 23737b405..4025fcc88 100644 --- a/src/cmp/proclamations.lsp +++ b/src/cmp/proclamations.lsp @@ -1137,7 +1137,7 @@ #+wants-sockets (proclamation si:open-server-stream (unsigned-byte) stream) #+wants-sockets -(proclamation si:open-unix-socket-stream (base-string) stream) +(proclamation si:open-unix-socket-stream (string) stream) #+wants-sockets (proclamation si:lookup-host-entry (t) (values (or null string) list list)) (proclamation si:copy-stream (stream stream) t)