[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-commits-diffs] org.debian.monotone: 56c0dcfe71f83c11c72abe8960
From: |
code |
Subject: |
[Monotone-commits-diffs] org.debian.monotone: 56c0dcfe71f83c11c72abe8960a5f6dc7d63314a |
Date: |
Thu, 14 Mar 2013 21:03:04 +0100 (CET) |
revision: 56c0dcfe71f83c11c72abe8960a5f6dc7d63314a
date: 2013-03-14T20:02:17
author: address@hidden
branch: org.debian.monotone
changelog:
Fix compilation on hurd, back-porting an upstream fix in
patches/05-hurd-compilation-fix.diff. Closes: #624779.
manifest:
format_version "1"
new_manifest [f0eea8e592be9de361385e52d6f7d652a4844f52]
old_revision [7a039fb5cf03277e86838e2ef382f79b71a5ff80]
add_file "patches/05-hurd-compilation-fix.diff"
content [8d2765907988c7ea9abbe92ec8a72160576a0ebe]
patch "changelog"
from [ffcfdbd761cd5007a9f58dfb7f2eab2cc1993d46]
to [72c91638c081d582d275727a9925e3b8eb914f46]
patch "patches/series"
from [c6d8e971baca71354a07d06ef2f7ddea935fd430]
to [21552d38083621973eba28cf85926d9d8dfa72d9]
============================================================
--- changelog ffcfdbd761cd5007a9f58dfb7f2eab2cc1993d46
+++ changelog 72c91638c081d582d275727a9925e3b8eb914f46
@@ -1,9 +1,12 @@
-monotone (1.0-7) UNRELEASED; urgency=low
+monotone (1.0-7) experimental; urgency=low
+ * Team upload.
+ * Fix compilation on hurd, back-porting an upstream fix in
+ patches/05-hurd-compilation-fix.diff. Closes: #624779.
* Add Brazilian Portuguese translation by Adriano Rafael Gomes.
Closes: #693378.
- -- Markus Wanner <address@hidden> Fri, 08 Mar 2013 21:44:48 +0100
+ -- Markus Wanner <address@hidden> Thu, 14 Mar 2013 21:00:46 +0100
monotone (1.0-6) unstable; urgency=low
============================================================
--- /dev/null
+++ patches/05-hurd-compilation-fix.diff 8d2765907988c7ea9abbe92ec8a72160576a0ebe
@@ -0,0 +1,80 @@
+Description: fix compilation on hurd-i386
+ Do not rely on MAXPATHLEN to be defined. Instead iteratively call getcwd()
+ with an increasing buffer size until the current path fits.
+Bug-Debian: http://bugs.debian.org/624779
+Origin: upstream, backport of 64e690fd0e14f6a0ad816d8fd55044f36d8559d5,
+ d23dbf2ce78cd11fc1a1dc85cd78cc28ab2df8ca and
+ c14cb021dafa331f859634a14087f6f81d870aed
+============================================================
+--- a/src/netxx/serverbase.cxx
++++ b/src/netxx/serverbase.cxx
+@@ -44,6 +44,9 @@
+ #include "probeinfo.h"
+ #include "socket.h"
+
++// Monotone specific, for get_current_working_dir()
++#include <src/platform.hh>
++
+ // standard includes
+ #include <map>
+ #include <vector>
+@@ -167,14 +170,16 @@
+ if (saun->sun_path[0] == '/') {
+ files_.push_back(saun->sun_path);
+ } else {
+- char buffer[MAXPATHLEN];
+-
+- if (getcwd(buffer, sizeof(buffer))) {
+- std::string fullpath = buffer; fullpath += '/'; fullpath += saun->sun_path;
+- files_.push_back(fullpath);
+- } else {
+- files_.push_back(saun->sun_path);
+- }
++ /*
++ * the original (netxx) code here relied on MAXPATHLEN,
++ * which isn't defined on hurd. As netxx seems to only
++ * live on within monotone, we can as well make it
++ * inter-dependent. And the unix/fs.cc variant certainly
++ * gets more test mileage than anything special here.
++ */
++ std::string fullpath = get_current_working_dir();
++ fullpath += '/'; fullpath += saun->sun_path;
++ files_.push_back(fullpath);
+ }
+ }
+ # endif
+--- a/src/unix/fs.cc
++++ b/src/unix/fs.cc
+@@ -41,14 +41,26 @@
+ string
+ get_current_working_dir()
+ {
+- char buffer[4096];
+- if (!getcwd(buffer, 4096))
++ std::vector<char> cwd_buf;
++ size_t cwd_sz = 4096;
++
++ // This funny loop prevents having to specify a MAXPATHLEN or similar, but
++ // uses a dynamic approach, repeatedly calling getcwd() until our buffer
++ // is big enough for the current path to fit. Think of it as a portable
++ // replacement for get_current_dir_name(), which is GNU-only.
++ do
+ {
+- const int err = errno;
+- E(false, origin::system,
+- F("cannot get working directory: %s") % os_strerror(err));
++ cwd_buf.resize(cwd_sz);
++ if (getcwd(&cwd_buf[0], cwd_sz))
++ return string(&cwd_buf[0]);
++
++ cwd_sz += 4096;
+ }
+- return string(buffer);
++ while (errno == ERANGE);
++
++ const int err = errno;
++ E(false, origin::system,
++ F("cannot get working directory: %s") % os_strerror(err));
+ }
+
+ void
============================================================
--- patches/series c6d8e971baca71354a07d06ef2f7ddea935fd430
+++ patches/series 21552d38083621973eba28cf85926d9d8dfa72d9
@@ -3,5 +3,6 @@ 04-botan-1.10-adaption.diff
02-file_handle.diff
03-url_escaping.diff
04-botan-1.10-adaption.diff
+05-hurd-compilation-fix.diff
10-mtn-ignore-syntax-error-test.diff
90-stacktrace-on-crash.diff
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-commits-diffs] org.debian.monotone: 56c0dcfe71f83c11c72abe8960a5f6dc7d63314a,
code <=