From 913b48f90d01f856e115f0cb432ed3db5c46e71f Mon Sep 17 00:00:00 2001 From: "Alexis H. Rivera" Date: Tue, 25 Jan 2022 07:33:18 -0700 Subject: [PATCH] fixes to compile sbcl on termux using ecl --- contrib/sb-posix/posix-tests.lisp | 12 ++++++------ src/runtime/run-program.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/sb-posix/posix-tests.lisp b/contrib/sb-posix/posix-tests.lisp index 7c94a430d..7e9d694ba 100644 --- a/contrib/sb-posix/posix-tests.lisp +++ b/contrib/sb-posix/posix-tests.lisp @@ -527,7 +527,7 @@ 3 #\f #\o #\o) (deftest opendir.1 - (let ((dir (sb-posix:opendir "/"))) + (let ((dir (sb-posix:opendir *current-directory*))) (unwind-protect (sb-alien:null-alien dir) (unless (sb-alien:null-alien dir) (sb-posix:closedir dir)))) @@ -535,7 +535,7 @@ #-(and darwin x86) (deftest readdir.1 - (let ((dir (sb-posix:opendir "/"))) + (let ((dir (sb-posix:opendir *current-directory*))) (unwind-protect (block dir-loop (loop for dirent = (sb-posix:readdir dir) @@ -868,10 +868,10 @@ #-win32 (deftest mkstemp.null-terminate - (let* ((default (make-pathname :directory '(:absolute "tmp"))) + (let* ((default *test-directory*) (filename (namestring (make-pathname :name "mkstemp-1" :type "XXXXXX" - :defaults default))) + ))) ;; The magic 64 is the filename length that happens to ;; trigger the no null termination bug at least on my ;; machine on a certain build. @@ -883,9 +883,9 @@ (make-string n :initial-element #\x)) :defaults default)) (unwind-protect - (values (integerp fd) (subseq temp 0 (position #\. temp))) + (values (integerp fd) (subseq (pathname-name temp) 0 (position #\. (pathname-name temp)))) (delete-file temp)))) - t "/tmp/mkstemp-1") + t "mkstemp-1") (deftest envstuff (let ((name1 "ASLIFJLSDKFJKAHGSDKLJH") diff --git a/src/runtime/run-program.c b/src/runtime/run-program.c index 929ac9914..fc48ebc40 100644 --- a/src/runtime/run-program.c +++ b/src/runtime/run-program.c @@ -100,7 +100,7 @@ void closefrom_fallback(int lowfd) { int fd, maxfd; -#ifdef SVR4 +#if defined(SVR4) || defined(LISP_FEATURE_ANDROID) maxfd = sysconf(_SC_OPEN_MAX)-1; #else maxfd = getdtablesize()-1; -- 2.34.1