From: Stelian Ionescu Date: Sat, 9 Mar 2013 23:36:37 +0000 (+0100) Subject: Fix isys/ptsname following libfixposix API change X-Git-Tag: v0.8.0~3 X-Git-Url: https://repo.or.cz/w/iolib.git/commitdiff_plain/269ca0a80104aa97f307d3c3a91d32ba1e45ee7c Fix isys/ptsname following libfixposix API change --- diff --git a/src/syscalls/ffi-functions-unix.lisp b/src/syscalls/ffi-functions-unix.lisp index 80725e9..42549c1 100644 --- a/src/syscalls/ffi-functions-unix.lisp +++ b/src/syscalls/ffi-functions-unix.lisp @@ -484,13 +484,14 @@ Return two values: the file descriptor and the path of the temporary file." (defsyscall (%ptsname "lfp_ptsname") (:pointer :handle fd) - (fd :int)) + (fd :int) + (buf :pointer) + (buflen size-t)) (defentrypoint ptsname (fd) - (let ((str (%ptsname fd))) - (unwind-protect - (nth-value 0 (foreign-string-to-lisp str)) - (foreign-free str)))) + (with-foreign-pointer (buf +cstring-path-max+ bufsize) + (%ptsname fd buf bufsize) + (nth-value 0 (foreign-string-to-lisp buf)))) ;;;-------------------------------------------------------------------------