X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Fplanner.c;h=c8501e2f35aced2ab93db61374600e0fd921c0ef;hb=refs%2Ftags%2Fupstream%2F3.3.1;hp=eceb2bc9bd04a06c6c14677fae06985e65c7b0ad;hpb=cd0b924f27312d57bd42f6c4fae2b795139e2d0b;p=debian%2Famanda diff --git a/server-src/planner.c b/server-src/planner.c index eceb2bc..c8501e2 100644 --- a/server-src/planner.c +++ b/server-src/planner.c @@ -193,6 +193,11 @@ main( gboolean no_taper = FALSE; gboolean from_client = FALSE; + if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) { + printf("planner-%s\n", VERSION); + return (0); + } + /* * Configure program for internationalization: * 1) Only set the message locale for now. @@ -1021,6 +1026,10 @@ setup_estimate( case DS_STANDARD: case DS_NOINC: askfor(ep, i++, 0, &info); + if (ep->last_level == -1) + ep->degr_mesg = _("Skipping: new disk can't be dumped in degraded mode"); + else + ep->degr_mesg = _("Skipping: strategy NOINC can't be dumped in degraded mode"); if(dp->skip_full) { log_add(L_INFO, _("Ignoring skip-full for %s:%s " "because the strategy is NOINC."), @@ -1975,7 +1984,8 @@ static void handle_result( break; } } - if (i == MAX_LEVELS) { + if (i == MAX_LEVELS && level > 0) { + /* client always report level 0 for some error */ goto bad_msg; /* this est wasn't requested */ } est(dp)->got_estimate++; @@ -2979,7 +2989,8 @@ static int promote_hills(void) } for(dp = schedq.head; dp != NULL; dp = dp->next) { - days = est(dp)->next_level0; /* This is > 0 by definition */ + days = est(dp)->next_level0; + if (days < 0) days = 0; if(daysskip_full && dp->strategy != DS_NOFULL && dp->strategy != DS_INCRONLY) { sp[days].disks++;