Skip to content

Instantly share code, notes, and snippets.

@amuramatsu
Created September 28, 2020 14:01
Show Gist options
  • Save amuramatsu/8928f1fd45c4bfea6a3276673ea9cbfb to your computer and use it in GitHub Desktop.
Save amuramatsu/8928f1fd45c4bfea6a3276673ea9cbfb to your computer and use it in GitHub Desktop.
diff -ruN clisp-2.49.92.orig/Makefile.devel clisp-2.49.92/Makefile.devel
--- clisp-2.49.92.orig/Makefile.devel 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/Makefile.devel 2020-09-28 17:00:26.430903935 +0900
@@ -397,7 +397,7 @@
GNULIB_SYSCALLS = mktime strftime strptime strverscmp uname fnmatch-gnu
GNULIB_IMPORTS = $(GNULIB_CORE) $(GNULIB_SYSCALLS) regex recvfrom sendto
GNULIB_COMMON = $(GNULIB_CORE) $(GNULIB_MODULES)
-GNULIB_IMPORTED_LOG = /tmp/gnulib-imported.log
+GNULIB_IMPORTED_LOG = /data/data/com.termux/files/usr/tmp/gnulib-imported.log
gnulib-imported : update-gnulib force
$(RMRF) src/glm4 src/gllib
@@ -509,8 +509,8 @@
BROWSERS=firefox mozilla netscape opera links lynx
view-html :
- grep -v '^#[ie]' doc/_clisp.html > /tmp/clisp.html
- for b in $(BROWSERS); do $$b /tmp/clisp.html; done
+ grep -v '^#[ie]' doc/_clisp.html > /data/data/com.termux/files/usr/tmp/clisp.html
+ for b in $(BROWSERS); do $$b /data/data/com.termux/files/usr/tmp/clisp.html; done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff -ruN clisp-2.49.92.orig/modules/asdf/asdf.lisp clisp-2.49.92/modules/asdf/asdf.lisp
--- clisp-2.49.92.orig/modules/asdf/asdf.lisp 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/modules/asdf/asdf.lisp 2020-09-28 14:49:09.443401717 +0900
@@ -4184,7 +4184,7 @@
(os-cond
((os-unix-p)
(or (getenv-pathname "TMPDIR" :ensure-directory t)
- (parse-native-namestring "/tmp/")))
+ (parse-native-namestring "/data/data/com.termux/files/usr/tmp/")))
((os-windows-p)
(getenv-pathname "TEMP" :ensure-directory t))
(t (subpathname (user-homedir-pathname) "tmp/"))))
diff -ruN clisp-2.49.92.orig/modules/bindings/glibc/linux.lisp clisp-2.49.92/modules/bindings/glibc/linux.lisp
--- clisp-2.49.92.orig/modules/bindings/glibc/linux.lisp 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/modules/bindings/glibc/linux.lisp 2020-09-28 14:50:25.087401721 +0900
@@ -1701,7 +1701,7 @@
(def-c-type fpos_t _G_fpos_t)
-(defconstant P_tmpdir "/tmp")
+(defconstant P_tmpdir "/data/data/com.termux/files/usr/tmp")
(def-c-var stdin (:type FILE))
(def-c-var stdout (:type FILE))
diff -ruN clisp-2.49.92.orig/modules/clx/mit-clx/Makefile clisp-2.49.92/modules/clx/mit-clx/Makefile
--- clisp-2.49.92.orig/modules/clx/mit-clx/Makefile 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/modules/clx/mit-clx/Makefile 2020-09-28 17:01:25.842903938 +0900
@@ -80,10 +80,10 @@
distrib : src-distrib clisp-distrib
src-distrib : force
- $(PACK) $(PACKOPT) /tmp/clx-src$(PACKEXT) README Makefile *.lisp *.txt
+ $(PACK) $(PACKOPT) /data/data/com.termux/files/usr/tmp/clx-src$(PACKEXT) README Makefile *.lisp *.txt
clisp-distrib : force clx.mem
- $(PACK) $(PACKOPT) /tmp/clx$(PACKEXT) README clx.mem
+ $(PACK) $(PACKOPT) /data/data/com.termux/files/usr/tmp/clx$(PACKEXT) README clx.mem
# Make a module
diff -ruN clisp-2.49.92.orig/modules/clx/mit-clx/dependent.lisp clisp-2.49.92/modules/clx/mit-clx/dependent.lisp
--- clisp-2.49.92.orig/modules/clx/mit-clx/dependent.lisp 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/modules/clx/mit-clx/dependent.lisp 2020-09-28 01:40:13.425000136 +0900
@@ -584,7 +584,7 @@
;;;
(defparameter *X-unix-socket-path*+
- "/tmp/.X11-unix/X"
+ "/data/data/com.termux/files/usr/tmp/.X11-unix/X"
"The location of the X socket")
(defun open-x-stream (host display protocol)
diff -ruN clisp-2.49.92.orig/modules/clx/new-clx/clx.lisp clisp-2.49.92/modules/clx/new-clx/clx.lisp
--- clisp-2.49.92.orig/modules/clx/new-clx/clx.lisp 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/modules/clx/new-clx/clx.lisp 2020-09-28 17:03:12.170903945 +0900
@@ -363,7 +363,7 @@
;; (eval-when (:compile-toplevel)
;; (defpackage #:posix (:export #:mkstemp)))
;; (defun resource-database-to-string (rdb)
-;; (let ((tmp-file (posix:mkstemp "/tmp/rdb")))
+;; (let ((tmp-file (posix:mkstemp "/data/data/com.termux/files/usr/tmp/rdb")))
;; (close tmp-file)
;; (write-resources rdb tmp-file)
;; (unwind-protect
diff -ruN clisp-2.49.92.orig/modules/syscalls/posix.lisp clisp-2.49.92/modules/syscalls/posix.lisp
--- clisp-2.49.92.orig/modules/syscalls/posix.lisp 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/modules/syscalls/posix.lisp 2020-09-28 01:44:31.193000152 +0900
@@ -404,7 +404,7 @@
;;;--------------------------------------------------------------------------
#+unix
(defun make-xterm-io-stream (&key (title "CLISP I/O") (xterm "xterm"))
- (let* ((tmpdir (mkdtemp "/tmp/clisp-x-io-XXXXXX/"))
+ (let* ((tmpdir (mkdtemp "/data/data/com.termux/files/usr/tmp/clisp-x-io-XXXXXX/"))
(pipe (namestring (merge-pathnames "pipe" tmpdir)))
xio
(clos::*enable-clos-warnings* nil))
diff -ruN clisp-2.49.92.orig/src/clisp-link.in clisp-2.49.92/src/clisp-link.in
--- clisp-2.49.92.orig/src/clisp-link.in 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/src/clisp-link.in 2020-09-28 17:02:21.686903942 +0900
@@ -117,7 +117,7 @@
# Use the environment variable TMPDIR, falling back to /tmp. This allows
# users to specify a different temporary directory, for example, if their
# /tmp is filled up or too small.
- : ${TMPDIR=/tmp}
+ : ${TMPDIR=/data/data/com.termux/files/usr/tmp}
{
# Use the mktemp program if available. If not available, hide the error
# message.
diff -ruN clisp-2.49.92.orig/src/disassem.lisp clisp-2.49.92/src/disassem.lisp
--- clisp-2.49.92.orig/src/disassem.lisp 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/src/disassem.lisp 2020-09-28 01:41:43.397000142 +0900
@@ -90,8 +90,8 @@
(format t (TEXT "Cannot show machine instructions: gdb not found."))
(return-from disassemble-machine-code nil))
(unless (stringp address) (setq address (format nil "~A" address)))
- (let ((tempfilename (format nil "/tmp/gdbcomm~D" pid))
- (outfilename (format nil "/tmp/gdbdis~D" pid))
+ (let ((tempfilename (format nil "/data/data/com.termux/files/usr/tmp/gdbcomm~D" pid))
+ (outfilename (format nil "/data/data/com.termux/files/usr/tmp/gdbdis~D" pid))
;; On Windows older than Windows XP, we cannot use gdb on the live
;; process, due to a limitation of the Win32 API.
;; See http://sources.redhat.com/ml/cygwin/2003-06/msg00933.html
@@ -136,7 +136,7 @@
(shell (format nil "~A ~A" (or (getenv "PAGER") "more") outfilename)))
(delete-file outfilename))
#| ;; This uses SunOS dbx. (Untested.)
- (let ((tempfilename (format nil "/tmp/dbxcomm~D" pid)))
+ (let ((tempfilename (format nil "/data/data/com.termux/files/usr/tmp/dbxcomm~D" pid)))
(with-open-file (f tempfilename :direction :output)
(format f "~A/100i~%" address) ; disassemble
(format f "detach~%") ; let lisp.run continue
@@ -144,7 +144,7 @@
(shell (format nil "~A -s ~A ~A ~D" "dbx"
tempfilename program-name pid))) |#
#| ;; This uses AIX dbx. (Untested.)
- (let ((tempfilename (format nil "/tmp/dbxcomm~D" pid)))
+ (let ((tempfilename (format nil "/data/data/com.termux/files/usr/tmp/dbxcomm~D" pid)))
(with-open-file (f tempfilename :direction :output)
(format f "~A/100i~%" address) ; disassemble
(format f "detach~%") ; let lisp.run continue
diff -ruN clisp-2.49.92.orig/src/gllib/tempname.c clisp-2.49.92/src/gllib/tempname.c
--- clisp-2.49.92.orig/src/gllib/tempname.c 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/src/gllib/tempname.c 2020-09-28 14:51:06.563401724 +0900
@@ -32,7 +32,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "/data/data/com.termux/files/usr/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
@@ -147,8 +147,8 @@
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "/data/data/com.termux/files/usr/tmp") != 0 && direxists ("/data/data/com.termux/files/usr/tmp"))
+ dir = "/data/data/com.termux/files/usr/tmp";
else
{
__set_errno (ENOENT);
diff -ruN clisp-2.49.92.orig/src/socket.d clisp-2.49.92/src/socket.d
--- clisp-2.49.92.orig/src/socket.d 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/src/socket.d 2020-09-28 01:43:50.133000149 +0900
@@ -446,7 +446,7 @@
/* set X_UNIX_PATH and - on hpux only - OLD_UNIX_PATH */
#ifndef X_UNIX_PATH
#ifndef hpux
- #define X_UNIX_PATH "/tmp/.X11-unix/X"
+ #define X_UNIX_PATH "/data/data/com.termux/files/usr/tmp/.X11-unix/X"
#else
#define X_UNIX_PATH "/usr/spool/sockets/X11/"
#define OLD_UNIX_PATH "/tmp/.X11-unix/X"
diff -ruN clisp-2.49.92.orig/src/stream.d clisp-2.49.92/src/stream.d
--- clisp-2.49.92.orig/src/stream.d 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/src/stream.d 2020-09-28 21:51:08.516000060 +0900
@@ -3545,7 +3545,7 @@
#endif
#ifdef UNIX_TERM_TERMIOS
if (!( TCDRAIN(handle) ==0)) {
- if (!((errno==ENOTTY)||IS_EINVAL))
+ if (!((errno==ENOTTY)||(errno==EACCES)||IS_EINVAL))
{ OS_error(); } /* no TTY: OK, report other Error */
} else goto ok;
#endif
diff -ruN clisp-2.49.92.orig/tests/excepsit.tst clisp-2.49.92/tests/excepsit.tst
--- clisp-2.49.92.orig/tests/excepsit.tst 2018-02-18 21:07:29.000000000 +0900
+++ clisp-2.49.92/tests/excepsit.tst 2020-09-28 02:54:06.765000401 +0900
@@ -812,7 +812,7 @@
type-error
#+(and UNIX (not BeOS))
-(progn (open "/etc/passwd" :direction :input :if-exists :error) (/ 0))
+(progn (open "/data/data/com.termux/files/usr/etc/resolv.conf" :direction :input :if-exists :error) (/ 0))
#+(and UNIX (not BeOS))
division-by-zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment