Package: zeroc-ice / 3.5.1-6

hurd-fixes.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Index: zeroc-ice-package/cpp/src/IceUtil/FileUtil.cpp
===================================================================
--- zeroc-ice-package.orig/cpp/src/IceUtil/FileUtil.cpp	2013-12-18 00:22:40.041991841 +0100
+++ zeroc-ice-package/cpp/src/IceUtil/FileUtil.cpp	2013-12-18 00:22:40.037991811 +0100
@@ -13,6 +13,7 @@
 #include <IceUtil/Exception.h>
 #include <climits>
 #include <string.h>
+#include <memory>
 
 #ifdef _WIN32
 #  include <process.h>
@@ -338,11 +339,15 @@
 int
 IceUtilInternal::getcwd(string& cwd)
 {
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+    std::auto_ptr<char> cwdbuf = get_current_dir_name();
+#else
     char cwdbuf[PATH_MAX];
     if(::getcwd(cwdbuf, PATH_MAX) == NULL)
     {
-        return -1;
+	return -1;
     }
+#endif
     cwd = cwdbuf;
     return 0;
 }
Index: zeroc-ice-package/cpp/src/IceUtil/Thread.cpp
===================================================================
--- zeroc-ice-package.orig/cpp/src/IceUtil/Thread.cpp	2013-12-18 00:22:40.041991841 +0100
+++ zeroc-ice-package/cpp/src/IceUtil/Thread.cpp	2013-12-18 00:22:40.037991811 +0100
@@ -706,10 +706,13 @@
     }
     if(stackSize > 0)
     {
+
+#ifdef PTHREAD_STACK_MIN
         if(stackSize < PTHREAD_STACK_MIN)
         {
             stackSize = PTHREAD_STACK_MIN;
         }
+#endif
 #ifdef __APPLE__
         if(stackSize % 4096 > 0)
         {
@@ -717,12 +720,16 @@
         }
 #endif
         rc = pthread_attr_setstacksize(&attr, stackSize);
+// Missing pthread stack min indicates setstacksize will probably fail
+// (GNU/Hurd uses fixed size stacks). Let's just ignore it.
+#ifdef PTHREAD_STACK_MIN
         if(rc != 0)
         {
             __decRef();
             pthread_attr_destroy(&attr);
             throw ThreadSyscallException(__FILE__, __LINE__, rc);
         }
+#endif
     }
 
     if(realtimeScheduling)
Index: zeroc-ice-package/cpp/src/Slice/Util.cpp
===================================================================
--- zeroc-ice-package.orig/cpp/src/Slice/Util.cpp	2013-12-18 00:22:40.041991841 +0100
+++ zeroc-ice-package/cpp/src/Slice/Util.cpp	2013-12-18 00:22:40.037991811 +0100
@@ -12,6 +12,7 @@
 #include <IceUtil/FileUtil.h>
 #include <IceUtil/StringUtil.h>
 #include <climits>
+#include <memory>
 
 #include <unistd.h> // For readlink()
 
@@ -114,7 +115,11 @@
             subpath = result.substr(0, next);
         }
 
+#ifdef PATH_MAX
         char buf[PATH_MAX + 1];
+#else
+	auto_ptr<char> buf = new char[pathconf ("/", _PC_PATH_MAX) + 1];
+#endif
         int len = static_cast<int>(readlink(subpath.c_str(), buf, sizeof(buf)));
         if(len > 0)
         {