Hi,
It was a fix because setting etimeout to 0 was a bug, but I forgot about
negative etimeout.
The attached patch should fix it.
Jean-Louis
Dustin J. Mitchell wrote:
On Tue, Jun 8, 2010 at 3:58 PM, Marc Muehlfeld
<marc.muehlf...@medizinische-genetik.de> wrote:
> ETIMEOUT must be positive
But the manpage says:
etimeout int
..... A negative value will be interpreted as a total amount of time to wait
per client instead of per disk.
Who's wrong? Manpage or program code?
Well, it was changed in this commit:
commit 1a2051ece2e27fea65b9bf05dac235a7e358f52a
Author: Jean-Louis Martineau <martin...@zmanda.com>
Date: Thu Dec 17 17:41:01 2009 +0000
* common-src/conffile.c: etimeout must be positive.
* common-src/protocol.c: Fix possible timeout of 0.
git-svn-id:
https://amanda.svn.sourceforge.net/svnroot/amanda/amanda/tr...@2358
a8d146d6-cc15-0410-8900-af154a0219e0
I don't remember the motivation for the change, though - maybe JLM
does. But the upshot is that it looks like the manpage was not
properly updated.
Dustin
diff --git a/common-src/conffile.c b/common-src/conffile.c
index aed45c4..70c3149 100644
--- a/common-src/conffile.c
+++ b/common-src/conffile.c
@@ -518,6 +518,7 @@ static void ckseen(seen_t *seen);
* a parser table entry. They call conf_parserror if the value in their
* second argument is invalid. */
static void validate_nonnegative(conf_var_t *, val_t *);
+static void validate_non_zero(conf_var_t *, val_t *);
static void validate_positive(conf_var_t *, val_t *);
static void validate_runspercycle(conf_var_t *, val_t *);
static void validate_bumppercent(conf_var_t *, val_t *);
@@ -1135,7 +1136,7 @@ conf_var_t server_var [] = {
{ CONF_INPARALLEL , CONFTYPE_INT , read_int , CNF_INPARALLEL , validate_inparallel },
{ CONF_DUMPORDER , CONFTYPE_STR , read_str , CNF_DUMPORDER , NULL },
{ CONF_MAXDUMPS , CONFTYPE_INT , read_int , CNF_MAXDUMPS , validate_positive },
- { CONF_ETIMEOUT , CONFTYPE_INT , read_int , CNF_ETIMEOUT , validate_positive },
+ { CONF_ETIMEOUT , CONFTYPE_INT , read_int , CNF_ETIMEOUT , validate_non_zero },
{ CONF_DTIMEOUT , CONFTYPE_INT , read_int , CNF_DTIMEOUT , validate_positive },
{ CONF_CTIMEOUT , CONFTYPE_INT , read_int , CNF_CTIMEOUT , validate_positive },
{ CONF_DEVICE_OUTPUT_BUFFER_SIZE, CONFTYPE_SIZE , read_size , CNF_DEVICE_OUTPUT_BUFFER_SIZE, validate_positive },
@@ -4101,6 +4102,33 @@ validate_nonnegative(
}
static void
+validate_non_zero(
+ struct conf_var_s *np,
+ val_t *val)
+{
+ switch(val->type) {
+ case CONFTYPE_INT:
+ if(val_t__int(val) == 0)
+ conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+ break;
+ case CONFTYPE_INT64:
+ if(val_t__int64(val) == 0)
+ conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+ break;
+ case CONFTYPE_TIME:
+ if(val_t__time(val) == 0)
+ conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+ break;
+ case CONFTYPE_SIZE:
+ if(val_t__size(val) == 0)
+ conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+ break;
+ default:
+ conf_parserror(_("validate_non_zero invalid type %d\n"), val->type);
+ }
+}
+
+static void
validate_positive(
struct conf_var_s *np,
val_t *val)