return 0;
}
-
/*
* send Storage daemon address to the File daemon,
* then wait for File daemon to make connection
}
}
+ if (is_bnet_error(fd)) {
+ Jmsg(jcr, M_FATAL, 0, _("Network error during RESTORE command. ERR=%s\n"),
+ bnet_strerror(fd));
+ }
+ bnet_sig(fd, BNET_TERMINATE); /* tell Client we are terminating */
+
+
restore_cleanup(jcr, ok?jcr->FDJobStatus:JS_ErrorTerminated);
return 1;
{
char sdt[MAX_TIME_LENGTH], edt[MAX_TIME_LENGTH];
char ec1[30], ec2[30];
- char term_code[100];
+ char term_code[100], fd_term_msg[100];
char *term_msg;
int msg_type;
double kbps;
}
break;
case JS_Cancelled:
- term_msg = _("Restore Cancelled");
+ term_msg = _("Restore Canceled");
if (jcr->store_bsock) {
bnet_sig(jcr->store_bsock, BNET_TERMINATE);
pthread_cancel(jcr->SD_msg_chan);
bstrftime(sdt, sizeof(sdt), jcr->jr.StartTime);
bstrftime(edt, sizeof(edt), jcr->jr.EndTime);
kbps = (double)jcr->jr.JobBytes / (1000 * (jcr->jr.EndTime - jcr->jr.StartTime));
+ if (kbps < 0.05) {
+ kbps = 0;
+ }
+
+ jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg));
Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n\
JobId: %d\n\
Files Restored: %s\n\
Bytes Restored: %s\n\
Rate: %.1f KB/s\n\
+FD termination status: %s\n\
Termination: %s\n\n"),
edt,
jcr->jr.JobId,
edit_uint64_with_commas((uint64_t)jcr->jr.JobFiles, ec1),
edit_uint64_with_commas(jcr->jr.JobBytes, ec2),
(float)kbps,
+ fd_term_msg,
term_msg);
Dmsg0(20, "Leaving restore_cleanup\n");
/* Ensure where is terminated with a slash */
if (jcr->where[wherelen-1] != '/' && fn[0] != '/') {
strcat(ofile, "/");
- }
+ }
strcat(ofile, fn); /* copy rest of name */
- /* Fixup link name */
- if (type == FT_LNKSAVED || (type == FT_LNK && jcr->prefix_links)) {
- if (lp[0] == '/') { /* if absolute path */
+ /*
+ * Fixup link name -- add where only if requested
+ * and if it is an absolute path
+ */
+ if (type == FT_LNKSAVED || type == FT_LNK) {
+ int add_link;
+ if (jcr->prefix_links && lp[0] == '/') { /* if absolute path */
strcpy(lname, jcr->where);
- }
+ add_link = 1;
+ } else {
+ lname[0] = 0;
+ add_link = 0;
+ }
if (win32_client && lp[1] == ':') {
- strcat(lname, lp+2); /* copy rest of name */
+ fn = lp+2; /* skip over drive: */
} else {
- strcat(lname, lp); /* On Unix systems we take everything */
+ fn = lp; /* take whole name */
}
+ /* Ensure where is terminated with a slash */
+ if (add_link && jcr->where[wherelen-1] != '/' && fn[0] != '/') {
+ strcat(lname, "/");
+ }
+ strcat(lname, fn); /* copy rest of link */
}
}