On Sun, Dec 05, 2010 at 08:02:01PM -0500, Wietse Venema wrote:
> Both dependencies on non-library data are removed in snapshot 20101204.
Unfortunately DEF_COMMAND_MAXTIME is a string (time units), not an integer,
so we something along the lines of (untested, ...):
Index: src/global/pipe_command.c
--- src/global/pipe_command.c 6 Dec 2010 01:18:21 -0000 1.1.1.3
+++ src/global/pipe_command.c 6 Dec 2010 04:13:57 -0000
@@ -164,2 +164,3 @@
#include <dsn_buf.h>
+#include <conv_time.h>
@@ -186,2 +187,3 @@
static int pipe_command_maxtime; /* available time to complete */
+static int def_max_time = -1;
@@ -212,3 +214,11 @@
- pipe_command_maxtime = DEF_COMMAND_MAXTIME;
+#define TIME_UNIT(d) (*(d) ? (d)[strlen((d))-1] : 's')
+ if (def_max_time < 0) {
+ if (conv_time(DEF_COMMAND_MAXTIME, &def_max_time,
+ TIME_UNIT(DEF_COMMAND_MAXTIME)) == 0) {
+ msg_panic("%s: invalid default %s: \"%s\"", myname,
+ VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME);
+ }
+ }
+ pipe_command_maxtime = def_max_time;
--
Viktor.