termux-packages/packages/tar/tmpdir-path.patch

36 lines
1.3 KiB
Diff
Raw Normal View History

2019-03-02 13:53:02 +01:00
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);
2021-02-07 22:08:37 +01:00
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);
2019-03-02 13:53:02 +01:00
const char *tmp = getenv ("TMPDIR");
if (!tmp)
- tmp = "/tmp";
+ tmp = "@TERMUX_PREFIX@/tmp";
2021-02-07 22:08:37 +01:00
len = strlen (tmp) + strlen (global_header_template) + 1;
2019-03-02 13:53:02 +01:00
globexthdr_name = xmalloc (len);
strcpy(globexthdr_name, tmp);