1 |
swegener 08/06/15 18:52:28 |
2 |
|
3 |
Added: pdsh-2.14-gcc-4.3-unistd.h.patch |
4 |
pdsh-2.14-glibc-2.8-ARG_MAX.patch |
5 |
Log: |
6 |
Add compability patches for gcc-4.3 and glibc-2.8. |
7 |
(Portage version: 2.1.5.5) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-shells/pdsh/files/pdsh-2.14-gcc-4.3-unistd.h.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-shells/pdsh/files/pdsh-2.14-gcc-4.3-unistd.h.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-shells/pdsh/files/pdsh-2.14-gcc-4.3-unistd.h.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: pdsh-2.14-gcc-4.3-unistd.h.patch |
16 |
=================================================================== |
17 |
gcc-4.3 no longer includes this by default, needed to get the ssize_t type. |
18 |
|
19 |
--- pdsh-2.14/src/modules/machines.c |
20 |
+++ pdsh-2.14/src/modules/machines.c |
21 |
@@ -28,6 +28,8 @@ |
22 |
# include "config.h" |
23 |
#endif |
24 |
|
25 |
+#include <unistd.h> |
26 |
+ |
27 |
#include "src/pdsh/wcoll.h" |
28 |
#include "src/pdsh/mod.h" |
29 |
#include "src/common/hostlist.h" |
30 |
|
31 |
|
32 |
|
33 |
1.1 app-shells/pdsh/files/pdsh-2.14-glibc-2.8-ARG_MAX.patch |
34 |
|
35 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-shells/pdsh/files/pdsh-2.14-glibc-2.8-ARG_MAX.patch?rev=1.1&view=markup |
36 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-shells/pdsh/files/pdsh-2.14-glibc-2.8-ARG_MAX.patch?rev=1.1&content-type=text/plain |
37 |
|
38 |
Index: pdsh-2.14-glibc-2.8-ARG_MAX.patch |
39 |
=================================================================== |
40 |
glibc-2.8 no longer provides the ARG_MAX macro. |
41 |
|
42 |
--- pdsh-2.14/src/pdsh/xpopen.c |
43 |
+++ pdsh-2.14/src/pdsh/xpopen.c |
44 |
@@ -84,10 +84,17 @@ |
45 |
struct pid *cur; |
46 |
int fds[2], read, fd; |
47 |
pid_t pid; |
48 |
- char *av[ARG_MAX + 1]; |
49 |
int maxfd = sysconf(_SC_OPEN_MAX); |
50 |
+ long arg_max; |
51 |
+ char **av; |
52 |
+ |
53 |
+ arg_max = sysconf(_SC_ARG_MAX); |
54 |
+ if (arg_max < 0) |
55 |
+ errx("%p: unable to get _SC_OPEN_MAX (%m)\n"); |
56 |
+ |
57 |
+ av = Malloc(sizeof(char *) * (arg_max + 1)); |
58 |
|
59 |
- _parse_command_with_quotes(av, ARG_MAX, cmd); |
60 |
+ _parse_command_with_quotes(av, arg_max, cmd); |
61 |
|
62 |
if ((*mode != 'r' && *mode != 'w') || mode[1] != '\0') { |
63 |
errno = EINVAL; |
64 |
@@ -101,6 +106,7 @@ |
65 |
if (pipe(fds) < 0) { |
66 |
close(fds[0]); |
67 |
close(fds[1]); |
68 |
+ Free((void **) &av); |
69 |
Free((void **) &cur); |
70 |
errx("%p: unable to dup stdout\n"); |
71 |
} |
72 |
@@ -143,6 +149,8 @@ |
73 |
cur->next = pidlist; |
74 |
pidlist = cur; |
75 |
|
76 |
+ Free((void **) &av); |
77 |
+ |
78 |
return (cur->fp); |
79 |
|
80 |
} |
81 |
|
82 |
|
83 |
|
84 |
-- |
85 |
gentoo-commits@l.g.o mailing list |