Blob Blame History Raw
diff -up pdsh-2.16/src/pdsh/xpopen.c.BAD pdsh-2.16/src/pdsh/xpopen.c
--- pdsh-2.16/src/pdsh/xpopen.c.BAD	2008-08-28 11:05:44.000000000 -0400
+++ pdsh-2.16/src/pdsh/xpopen.c	2008-08-28 11:15:09.000000000 -0400
@@ -28,12 +28,19 @@
 #include "config.h"
 #endif
 
+#include <stdio.h>
+#include <limits.h>             /* ARG_MAX */
+
 #if	HAVE_UNISTD_H
 #include <unistd.h>             /* for R_OK, access() */
+# if defined(_SC_ARG_MAX)
+#  if defined(ARG_MAX)
+#     undef ARG_MAX
+#  endif
+#  define ARG_MAX sysconf (_SC_ARG_MAX)
+# endif
 #endif
 
-#include <stdio.h>
-#include <limits.h>             /* ARG_MAX */
 #include <sys/wait.h>           /* waitpid() */
 #include <string.h>             /* strcmp() */
 #include <stdlib.h>