Description: Changes needed for Hurd-i1386 support
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2018-06-28
Forwarded: no

Index: cctools-7.1.2/work_queue/src/work_queue.c
===================================================================
--- cctools-7.1.2.orig/work_queue/src/work_queue.c
+++ cctools-7.1.2/work_queue/src/work_queue.c
@@ -66,6 +66,10 @@ The following major problems must be fix
 #include <string.h>
 #include <time.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 // The default tasks capacity reported before information is available.
 // Default capacity also implies 1 core, 1024 MB of disk and 512 memory per task.
 #define WORK_QUEUE_DEFAULT_CAPACITY_TASKS 10
Index: cctools-7.1.2/work_queue/src/work_queue_process.c
===================================================================
--- cctools-7.1.2.orig/work_queue/src/work_queue_process.c
+++ cctools-7.1.2/work_queue/src/work_queue_process.c
@@ -29,6 +29,10 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #define SMALL_BUFFER_SIZE 256
 #define MAX_BUFFER_SIZE 4096
 #define DEFAULT_WORK_DIR "/home/worker"
Index: cctools-7.1.2/work_queue/src/work_queue_worker.c
===================================================================
--- cctools-7.1.2.orig/work_queue/src/work_queue_worker.c
+++ cctools-7.1.2/work_queue/src/work_queue_worker.c
@@ -66,6 +66,10 @@ See the file COPYING for details.
 #include <sys/utsname.h>
 #include <sys/wait.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 typedef enum {
 	WORKER_MODE_WORKER,
 	WORKER_MODE_FOREMAN
Index: cctools-7.1.2/resource_monitor/src/resource_monitor.c
===================================================================
--- cctools-7.1.2.orig/resource_monitor/src/resource_monitor.c
+++ cctools-7.1.2/resource_monitor/src/resource_monitor.c
@@ -159,6 +159,10 @@ See the file COPYING for details.
 #include <sys/ioctl.h>
 #endif
 
+#ifndef PATH_MAX // Not defined on Hurd
+#define PATH_MAX 1024
+#endif
+
 #include "rmonitor_helper_comm.h"
 #include "rmonitor_piggyback.h"
 
Index: cctools-7.1.2/resource_monitor/src/resource_monitor_histograms.c
===================================================================
--- cctools-7.1.2.orig/resource_monitor/src/resource_monitor_histograms.c
+++ cctools-7.1.2/resource_monitor/src/resource_monitor_histograms.c
@@ -19,6 +19,10 @@ See the file COPYING for details.
 
 #define MAX_LINE 1024
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX MAX_LINE
+#endif
+
 #define OUTLIER_DIR "outliers"
 #define OUTLIER_N    5
 
Index: cctools-7.1.2/resource_monitor/src/rmonitor_helper_comm.c
===================================================================
--- cctools-7.1.2.orig/resource_monitor/src/rmonitor_helper_comm.c
+++ cctools-7.1.2/resource_monitor/src/rmonitor_helper_comm.c
@@ -25,6 +25,10 @@ See the file COPYING for details.
 
 #include "rmonitor_helper_comm.h"
 
+#ifndef PATH_MAX // Not defined on Hurd
+#define PATH_MAX 1024
+#endif
+
 #include "debug.h"
 //#define debug fprintf
 //#define D_RMON stderr
Index: cctools-7.1.2/makeflow/src/dag_visitors.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/dag_visitors.c
+++ cctools-7.1.2/makeflow/src/dag_visitors.c
@@ -35,6 +35,9 @@ See the file COPYING for details.
 #include "dag_visitors.h"
 #include "rmsummary.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
 /*
  * BUG: Error handling is not very good.
  * BUG: Integrate more with dttools (use DEBUG, etc.)
Index: cctools-7.1.2/makeflow/src/makeflow_analyze.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_analyze.c
+++ cctools-7.1.2/makeflow/src/makeflow_analyze.c
@@ -47,6 +47,10 @@ See the file COPYING for details.
 #include "dag_visitors.h"
 #include "parser.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 /* Display options */
 enum { SHOW_INPUT_FILES = 2,
 	   SHOW_OUTPUT_FILES,
Index: cctools-7.1.2/makeflow/src/makeflow_linker.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_linker.c
+++ cctools-7.1.2/makeflow/src/makeflow_linker.c
@@ -25,6 +25,10 @@ See the file COPYING for details.
 #include "stringtools.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define MAKEFLOW_PATH "makeflow_analyze"
 #define MAKEFLOW_BUNDLE_FLAG "-b"
 
Index: cctools-7.1.2/makeflow/src/makeflow_log.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_log.c
+++ cctools-7.1.2/makeflow/src/makeflow_log.c
@@ -23,6 +23,10 @@ See the file COPYING for details.
 #include <string.h>
 #include <errno.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define MAX_BUFFER_SIZE 4096
 
 /*
Index: cctools-7.1.2/makeflow/src/makeflow_mounts.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_mounts.c
+++ cctools-7.1.2/makeflow/src/makeflow_mounts.c
@@ -32,6 +32,10 @@ See the file COPYING for details.
 #include "unlink_recursive.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define HTTP_TIMEOUT 300
 
 /* create_link creates a link from link_name to link_target.
Index: cctools-7.1.2/grow/src/grow_fuse.c
===================================================================
--- cctools-7.1.2.orig/grow/src/grow_fuse.c
+++ cctools-7.1.2/grow/src/grow_fuse.c
@@ -26,6 +26,10 @@
 #include "copy_stream.h"
 #include "jx_pretty_print.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifndef O_PATH
 #define O_PATH O_RDONLY
 #endif
Index: cctools-7.1.2/dttools/src/auth_ticket.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/auth_ticket.c
+++ cctools-7.1.2/dttools/src/auth_ticket.c
@@ -20,6 +20,10 @@ See the file COPYING for details.
 #include "sort_dir.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #include <sys/stat.h>
 
 #include <assert.h>
