From: Kern Sibbald Date: Thu, 17 Feb 2005 15:08:47 +0000 (+0000) Subject: Minor doc tweaks X-Git-Tag: Release-1.38.0~641 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dba0f68a36ac461dfdccf2cfb52c5b13089b2f57;p=bacula%2Fbacula Minor doc tweaks git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1832 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index f5c584c413..ccd7730253 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -30,6 +30,8 @@ Suggestions for Preben: - Optimized bootstrap. For 1.37: +- Try to open a device on each Job if it was not opened + when the SD started. - Windows restore: data-fd: RestoreFiles.2004-12-07_15.56.42 Error: > ..\findlib\../../findlib/create_file.c:275 Could not open e:/: ERR=Der diff --git a/bacula/src/dird/inc_conf.c b/bacula/src/dird/inc_conf.c index 51f4ced8b8..80f0d2f3bb 100644 --- a/bacula/src/dird/inc_conf.c +++ b/bacula/src/dird/inc_conf.c @@ -477,7 +477,7 @@ static void store_regex(LEX *lc, RES_ITEM *item, int index, int pass) int token, rc; regex_t preg; char prbuf[500]; - char *type; + const char *type; int newsize; token = lex_get_token(lc, T_SKIP_EOL); @@ -570,7 +570,7 @@ static void store_writer(LEX *lc, RES_ITEM *item, int index, int pass) static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass) { int token; - char *type; + const char *type; int newsize; token = lex_get_token(lc, T_SKIP_EOL); diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index d6faeadaa3..6690d949c8 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -58,7 +58,7 @@ static int open_sd_read_session(JCR *jcr); static int send_bootstrap_file(JCR *jcr); static int runbefore_cmd(JCR *jcr); static int runafter_cmd(JCR *jcr); -static int run_cmd(JCR *jcr, char *cmd, const char *name); +static bool run_cmd(JCR *jcr, char *cmd, const char *name); static void set_options(findFOPTS *fo, const char *opts); @@ -208,7 +208,7 @@ void *handle_client_request(void *dirp) } Dmsg1(100, "Executing %s command.\n", cmds[i].cmd); if (!cmds[i].func(jcr)) { /* do command */ - quit = true; /* error or fully terminated, get out */ + quit = true; /* error or fully terminated, get out */ Dmsg0(20, "Quit command loop due to command error or Job done.\n"); } break; @@ -412,7 +412,7 @@ static int job_cmd(JCR *jcr) static int runbefore_cmd(JCR *jcr) { - int stat; + bool ok; BSOCK *dir = jcr->dir_bsock; POOLMEM *cmd = get_memory(dir->msglen+1); @@ -427,9 +427,9 @@ static int runbefore_cmd(JCR *jcr) unbash_spaces(cmd); /* Run the command now */ - stat = run_cmd(jcr, cmd, "ClientRunBeforeJob"); + ok = run_cmd(jcr, cmd, "ClientRunBeforeJob"); free_memory(cmd); - if (stat) { + if (ok) { bnet_fsend(dir, OKRunBefore); return 1; } else { @@ -461,7 +461,7 @@ static int runafter_cmd(JCR *jcr) return bnet_fsend(dir, OKRunAfter); } -static int run_cmd(JCR *jcr, char *cmd, const char *name) +static bool run_cmd(JCR *jcr, char *cmd, const char *name) { POOLMEM *ecmd = get_pool_memory(PM_FNAME); int status; @@ -475,23 +475,23 @@ static int run_cmd(JCR *jcr, char *cmd, const char *name) berrno be; Jmsg(jcr, M_FATAL, 0, _("%s could not execute. ERR=%s\n"), name, be.strerror()); - return 0; + return false; } while (fgets(line, sizeof(line), bpipe->rfd)) { int len = strlen(line); - if (len > 0 && line[len-1] != '\n') { - bstrncat(line, "\n", sizeof(line)); + if (len > 0 && line[len-1] == '\n') { + line[len-1] = 0; } - Jmsg(jcr, M_INFO, 0, _("%s: %s"), name, line); + Jmsg(jcr, M_INFO, 0, _("%s: %s\n"), name, line); } status = close_bpipe(bpipe); if (status != 0) { berrno be; Jmsg(jcr, M_FATAL, 0, _("%s returned non-zero status=%d. ERR=%s\n"), name, status, be.strerror(status)); - return 0; + return false; } - return 1; + return true; } @@ -691,6 +691,7 @@ static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *filese } break; case '<': + Dmsg0(100, "Doing < include on client.\n"); p++; /* skip over < */ if ((ffd = fopen(p, "r")) == NULL) { berrno be; @@ -700,6 +701,7 @@ static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *filese } while (fgets(buf, sizeof(buf), ffd)) { strip_trailing_junk(buf); + Dmsg1(100, "%s\n", buf); fileset->incexe->name_list.append(bstrdup(buf)); } fclose(ffd); diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index c3bcf1ca51..fe3c00afba 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -72,7 +72,8 @@ int bclose_chksize(JCR *jcr, BFILE *bfd, off_t osize) void do_restore(JCR *jcr) { BSOCK *sd; - int32_t stream, prev_stream; + int32_t stream = 0; + int32_t prev_stream; uint32_t VolSessionId, VolSessionTime; bool extract = false; int32_t file_index; diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index 5ba631a717..402d57bdf5 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -1128,7 +1128,8 @@ close_bpipe(BPIPE *bpipe) bmicrosleep(1, 0); /* wait one second */ remaining_wait--; } else if (exitCode != 0) { - rval = exitCode | b_errno_exit; + /* Truncate exit code as it doesn't seem to be correct */ + rval = (exitCode & 0xFF) | b_errno_exit; break; } else { break; /* Shouldn't get here */