*
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2003 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
wherelen = strlen(jcr->where);
sd = jcr->store_bsock;
- jcr->JobStatus = JS_Running;
+ set_jcr_job_status(jcr, JS_Running);
if (!bnet_set_buffer_size(sd, MAX_NETWORK_BUFFER_SIZE, BNET_SETBUF_READ)) {
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
return;
}
jcr->buf_size = sd->msglen;
/*
* Now we expect the Stream Data
*/
- if (bnet_recv(sd) < 0 && !job_cancelled(jcr)) {
+ if (bnet_recv(sd) < 0) {
Jmsg1(jcr, M_FATAL, 0, _("Data record error. ERR=%s\n"), bnet_strerror(sd));
+ goto bail_out;
}
if (size != (uint32_t)sd->msglen) {
Jmsg2(jcr, M_FATAL, 0, _("Actual data size %d not same as header %d\n"), sd->msglen, size);
*/
if (extract) {
if (ofd < 0) {
- Emsg0(M_ERROR, 0, _("Logic error output file should be open\n"));
+ Jmsg0(jcr, M_ERROR, 0, _("Logic error output file should be open\n"));
}
set_attributes(jcr, fname, ofile, lname, type, stream,
&statp, attribsEx, &ofd);
break;
case CF_EXTRACT:
extract = TRUE;
+ P(jcr->mutex);
pm_strcpy(&jcr->last_fname, ofile);
+ V(jcr->mutex);
/* Fall-through wanted */
case CF_CREATED:
jcr->JobFiles++;
} else if (extract) {
Dmsg1(30, "Found wierd stream %d\n", stream);
if (ofd < 0) {
- Emsg0(M_ERROR, 0, _("Logic error output file should be open\n"));
+ Jmsg0(jcr, M_ERROR, 0, _("Logic error output file should be open\n"));
}
set_attributes(jcr, fname, ofile, lname, type, stream,
&statp, attribsEx, &ofd);
set_attributes(jcr, fname, ofile, lname, type, stream,
&statp, attribsEx, &ofd);
}
- jcr->JobStatus = JS_Terminated;
+ set_jcr_job_status(jcr, JS_Terminated);
goto ok_out;
bail_out:
- jcr->JobStatus = JS_ErrorTerminated;
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
ok_out:
if (jcr->compress_buf) {
free(jcr->compress_buf);
p = encode_time(statp->st_ctime, p);
*p++ = ' ';
*p++ = ' ';
- for (f=fname; *f && (p-buf) < (int)sizeof(buf); )
+ for (f=fname; *f && (p-buf) < (int)sizeof(buf)-10; ) {
*p++ = *f++;
+ }
if (type == FT_LNK) {
*p++ = ' ';
*p++ = '-';
*p++ = '>';
*p++ = ' ';
/* Copy link name */
- for (f=lname; *f && (p-buf) < (int)sizeof(buf); )
+ for (f=lname; *f && (p-buf) < (int)sizeof(buf)-10; ) {
*p++ = *f++;
+ }
}
*p++ = '\n';
*p = 0;
Dmsg0(20, buf);
- Jmsg(jcr, M_INFO, 0, buf);
+ Jmsg(jcr, M_INFO, 0, "%s", buf);
}