summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolis Ragkousis <manolis837@gmail.com>2015-06-08 16:19:58 +0300
committerManolis Ragkousis <manolis837@gmail.com>2015-06-12 15:46:25 +0300
commit16cae799dbddc621026c230d058e0317db0a1b95 (patch)
tree9e78777716835ce9df859e344c457a5d6ff15dcd
parent14928016556300a6763334d4279c3d117902caaf (diff)
gnu: patch: Set PATH_MAX for Hurd systems.
* gnu/packages/patches/patch-hurd-path-max.patch: New file. * gnu-system.am (dist_patch_DATA): Add it.
-rw-r--r--gnu-system.am1
-rw-r--r--gnu/packages/base.scm3
-rw-r--r--gnu/packages/patches/patch-hurd-path-max.patch48
3 files changed, 51 insertions, 1 deletions
diff --git a/gnu-system.am b/gnu-system.am
index 206c87680ee..5f2b6d912ee 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -505,6 +505,7 @@ dist_patch_DATA = \
505 gnu/packages/patches/patchelf-page-size.patch \ 505 gnu/packages/patches/patchelf-page-size.patch \
506 gnu/packages/patches/patchelf-rework-for-arm.patch \ 506 gnu/packages/patches/patchelf-rework-for-arm.patch \
507 gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \ 507 gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \
508 gnu/packages/patches/patch-hurd-path-max.patch \
508 gnu/packages/patches/pavucontrol-sigsegv.patch \ 509 gnu/packages/patches/pavucontrol-sigsegv.patch \
509 gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \ 510 gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \
510 gnu/packages/patches/perl-module-pluggable-search.patch \ 511 gnu/packages/patches/perl-module-pluggable-search.patch \
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 091e2f59ec8..fa7c9e884a0 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -161,7 +161,8 @@ standard utility.")
161 version ".tar.xz")) 161 version ".tar.xz"))
162 (sha256 162 (sha256
163 (base32 163 (base32
164 "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx")))) 164 "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx"))
165 (patches (list (search-patch "patch-hurd-path-max.patch")))))
165 (build-system gnu-build-system) 166 (build-system gnu-build-system)
166 (native-inputs `(("ed", ed))) 167 (native-inputs `(("ed", ed)))
167 (synopsis "Apply differences to originals, with optional backups") 168 (synopsis "Apply differences to originals, with optional backups")
diff --git a/gnu/packages/patches/patch-hurd-path-max.patch b/gnu/packages/patches/patch-hurd-path-max.patch
new file mode 100644
index 00000000000..81e37930c23
--- /dev/null
+++ b/gnu/packages/patches/patch-hurd-path-max.patch
@@ -0,0 +1,48 @@
1See <http://lists.gnu.org/archive/html/bug-patch/2015-06/msg00009.html>
2
3From 0507dfad5f060161f01840067e1bb1615257b636 Mon Sep 17 00:00:00 2001
4From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
5Date: Mon, 8 Jun 2015 17:27:56 +0200
6Subject: [PATCH] Do not rely on PATH_MAX when reading a symlink target.
7
8* src/util.c (move_file, copy_file): Use 'fromst->st_size + 1' and
9'tost->st_size + 1' for the allocation, and 'fromst->st_size' and
10'tost->st_size' instead of PATH_MAX. Fixes compilation on GNU/Hurd.
11---
12 src/util.c | 8 ++++----
13 1 file changed, 4 insertions(+), 4 deletions(-)
14
15diff --git a/src/util.c b/src/util.c
16index 82a7e37..c4c0f9d 100644
17--- a/src/util.c
18+++ b/src/util.c
19@@ -460,12 +460,12 @@ move_file (char const *from, bool *from_needs_removal,
20
21 /* FROM contains the contents of the symlink we have patched; need
22 to convert that back into a symlink. */
23- char *buffer = xmalloc (PATH_MAX);
24+ char *buffer = xmalloc (fromst->st_size + 1);
25 int fd, size = 0, i;
26
27 if ((fd = safe_open (from, O_RDONLY | O_BINARY, 0)) < 0)
28 pfatal ("Can't reopen file %s", quotearg (from));
29- while ((i = read (fd, buffer + size, PATH_MAX - size)) > 0)
30+ while ((i = read (fd, buffer + size, fromst->st_size - size)) > 0)
31 size += i;
32 if (i != 0 || close (fd) != 0)
33 read_fatal ();
34@@ -610,9 +610,9 @@ copy_file (char const *from, char const *to, struct stat *tost,
35
36 if (S_ISLNK (mode))
37 {
38- char *buffer = xmalloc (PATH_MAX);
39+ char *buffer = xmalloc (tost->st_size + 1);
40
41- if (safe_readlink (from, buffer, PATH_MAX) < 0)
42+ if (safe_readlink (from, buffer, tost->st_size) < 0)
43 pfatal ("Can't read %s %s", "symbolic link", from);
44 if (safe_symlink (buffer, to) != 0)
45 pfatal ("Can't create %s %s", "symbolic link", to);
46--
472.4.2
48