termux-packages/packages/tar/tmpdir-path.patch
2021-02-07 21:20:47 +00:00

36 lines
1.3 KiB
Diff

diff -uNr tar-1.31/gnu/tempname.c tar-1.31.mod/gnu/tempname.c
--- tar-1.31/gnu/tempname.c 2019-01-02 20:16:01.000000000 +0200
+++ tar-1.31.mod/gnu/tempname.c 2019-03-01 18:31:05.035530338 +0200
@@ -32,7 +32,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/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, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
diff -uNr tar-1.33/src/xheader.c tar-1.33.mod/src/xheader.c
--- tar-1.33/src/xheader.c 2021-01-06 15:52:09.000000000 +0000
+++ tar-1.33.mod/src/xheader.c 2021-02-07 21:18:57.425078913 +0000
@@ -404,7 +404,7 @@
const char *global_header_template = HEADER_TEMPLATE (pax_global_header);
const char *tmp = getenv ("TMPDIR");
if (!tmp)
- tmp = "/tmp";
+ tmp = "@TERMUX_PREFIX@/tmp";
len = strlen (tmp) + strlen (global_header_template) + 1;
globexthdr_name = xmalloc (len);
strcpy(globexthdr_name, tmp);