From: Kern Sibbald Date: Sun, 1 Sep 2002 12:04:52 +0000 (+0000) Subject: Fix Verify Error codes, some error messages X-Git-Tag: Release-1.25~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=32392f3a55efe8f85385afc8c5d1141fa6bb34dc;p=bacula%2Fbacula Fix Verify Error codes, some error messages git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@137 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 1d032d22b7..4a94c93a46 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -160,7 +160,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) strerror(ff_pkt->ff_errno)); return 1; default: - Jmsg(jcr, M_ERROR, 0, _("Unknown file type %d; not saved: %s\n"), ff_pkt->type, ff_pkt->fname); + Jmsg(jcr, M_NOTSAVED, 0, _("Unknown file type %d; not saved: %s\n"), ff_pkt->type, ff_pkt->fname); return 1; } diff --git a/bacula/src/filed/verify.c b/bacula/src/filed/verify.c index e7c9147b78..c675a4776c 100644 --- a/bacula/src/filed/verify.c +++ b/bacula/src/filed/verify.c @@ -85,6 +85,7 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt) switch (ff_pkt->type) { case FT_LNKSAVED: /* Hard linked, file already saved */ + Dmsg2(30, "FT_LNKSAVED saving: %s => %s\n", ff_pkt->fname, ff_pkt->link); break; case FT_REGE: Dmsg1(30, "FT_REGE saving: %s\n", ff_pkt->fname); @@ -102,13 +103,13 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt) Dmsg1(30, "FT_SPEC saving: %s\n", ff_pkt->fname); break; case FT_NOACCESS: - Jmsg(jcr, M_ERROR, -1, _(" Could not access %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); + Jmsg(jcr, M_NOTSAVED, -1, _(" Could not access %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); return 1; case FT_NOFOLLOW: - Jmsg(jcr, M_ERROR, -1, _(" Could not follow link %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); + Jmsg(jcr, M_NOTSAVED, -1, _(" Could not follow link %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); return 1; case FT_NOSTAT: - Jmsg(jcr, M_ERROR, -1, _(" Could not stat %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); + Jmsg(jcr, M_NOTSAVED, -1, _(" Could not stat %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); return 1; case FT_DIRNOCHG: case FT_NOCHG: @@ -124,10 +125,10 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt) Jmsg(jcr, M_SKIPPED, -1, _(" File system change prohibited. Directory skipped: %s\n"), ff_pkt->fname); return 1; case FT_NOOPEN: - Jmsg(jcr, M_ERROR, -1, _(" Could not open directory %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); + Jmsg(jcr, M_NOTSAVED, -1, _(" Could not open directory %s: ERR=%s\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); return 1; default: - Jmsg(jcr, M_ERROR, 0, _("Unknown file type %d: %s\n"), ff_pkt->type, ff_pkt->fname); + Jmsg(jcr, M_NOTSAVED, 0, _("Unknown file type %d: %s\n"), ff_pkt->type, ff_pkt->fname); return 1; } @@ -170,7 +171,7 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt) */ /* Send file attributes to Director (note different format than for Storage) */ Dmsg2(400, "send ATTR inx=%d fname=%s\n", jcr->JobFiles, ff_pkt->fname); - if (ff_pkt->type == FT_LNK) { + if (ff_pkt->type == FT_LNK || ff_pkt->tye == FT_LNKSAVED) { stat = bnet_fsend(dir, "%d %d %s %s%c%s%c%s%c", jcr->JobFiles, STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->fname, 0, attribs, 0, ff_pkt->link, 0); diff --git a/bacula/src/lib/lex.c b/bacula/src/lib/lex.c index 3f1105550d..85a3b3915d 100644 --- a/bacula/src/lib/lex.c +++ b/bacula/src/lib/lex.c @@ -111,7 +111,8 @@ lex_open_file(LEX *lf, char *filename, LEX_ERROR_HANDLER *scan_error) if ((fd = fopen(fname, "r")) == NULL) { - Emsg2(M_ABORT, 0, "Cannot open config file %s: %s\n", fname, strerror(errno)); + Emsg2(M_ERROR_TERM, 0, _("Cannot open config file %s: %s\n"), + fname, strerror(errno)); } Dmsg1(49, "Open config file: %s\n", fname); nf = (LEX *)malloc(sizeof(LEX)); @@ -184,7 +185,7 @@ lex_unget_char(LEX *lf) static void add_str(LEX *lf, int ch) { if (lf->str_len >= MAXSTRING-3) { - Emsg2(M_ABORT, 0, "Token too long, file: %s, line %s\n", lf->fname, lf->line_no); + Emsg2(M_ERROR_TERM, 0, "Token too long, file: %s, line %s\n", lf->fname, lf->line_no); } lf->str[lf->str_len++] = ch; lf->str[lf->str_len] = 0; diff --git a/bacula/src/lib/signal.c b/bacula/src/lib/signal.c index 50a0a46f6e..4829836110 100644 --- a/bacula/src/lib/signal.c +++ b/bacula/src/lib/signal.c @@ -92,7 +92,7 @@ static void signal_handler(int sig) strcat(exepath, "/"); strcat(exepath, exename); if (chdir(working_directory) !=0) { /* dump in working directory */ - Dmsg1(000, "chdir failed. ERR=%s\n", strerror(errno)); + Pmsg2(000, "chdir to %s failed. ERR=%s\n", working_directory, strerror(errno)); } unlink("./core"); /* get rid of any old core file */ sprintf(pid_buf, "%d", (int)main_pid);