many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
bool no_signals = false;
bool test_config = false;
JCR jcr;
+ utime_t heart_beat;
setlocale(LC_ALL, "");
bindtextdomain("bacula", LOCALEDIR);
LockRes();
numdir = 0;
foreach_res(dir, R_DIRECTOR) {
- senditf( _("%d %s at %s:%d\n"), 1+numdir++, dir->hdr.name, dir->address,
+ senditf( _("%2d: %s at %s:%d\n"), 1+numdir++, dir->hdr.name, dir->address,
dir->DIRport);
}
UnlockRes();
- if (get_cmd(stdin, _("Select Director: "), UA_sock, 600) < 0) {
+ if (get_cmd(stdin, _("Select Director by entering a number: "), UA_sock, 600) < 0) {
(void)WSACleanup(); /* Cleanup Windows sockets */
return 1;
}
+ if (!is_a_number(UA_sock->msg)) {
+ senditf(_("%s is not a number. You must enter a number between 1 and %d\n"),
+ UA_sock->msg, numdir);
+ goto try_again;
+ }
item = atoi(UA_sock->msg);
if (item < 0 || item > numdir) {
senditf(_("You must enter a number between 1 and %d\n"), numdir);
}
}
- UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
+ if (dir->heartbeat_interval) {
+ heart_beat = dir->heartbeat_interval;
+ } else if (cons) {
+ heart_beat = cons->heartbeat_interval;
+ } else {
+ heart_beat = 0;
+ }
+ UA_sock = bnet_connect(NULL, 5, 15, heart_beat, "Director daemon", dir->address,
NULL, dir->DIRport, 0);
if (UA_sock == NULL) {
terminate_console(0);
if (!fd) {
berrno be;
senditf(_("Cannot open file %s for output. ERR=%s\n"),
- argk[1], be.strerror(errno));
+ argk[1], be.bstrerror(errno));
return 1;
}
output = fd;
if (!bpipe) {
berrno be;
senditf(_("Cannot popen(\"%s\", \"r\"): ERR=%s\n"),
- argk[1], be.strerror(errno));
+ argk[1], be.bstrerror(errno));
return 1;
}
if (stat != 0) {
berrno be;
be.set_errno(stat);
- senditf(_("Autochanger error: ERR=%s\n"), be.strerror());
+ senditf(_("Autochanger error: ERR=%s\n"), be.bstrerror());
}
return 1;
}