]> git.sur5r.net Git - bacula/bacula/commitdiff
Display AllowCompress warning message only if compression used in FileSet
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 3 Mar 2010 08:11:58 +0000 (09:11 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 3 Mar 2010 08:12:45 +0000 (09:12 +0100)
bacula/src/dird/fd_cmds.c

index 71c6b1742c813cd47011e11ad535db5497cf7810..23b1da2593882f22301969a56ed258a8edb7ce1b 100644 (file)
@@ -375,21 +375,24 @@ static bool send_fileset(JCR *jcr)
             /* Strip out compression option Zn if disallowed for this Storage */
             if (store && !store->AllowCompress) {
                char newopts[MAX_FOPTS];
+               bool done=false;         /* print warning only if compression enabled in FS */ 
                int j = 0;
                for (k=0; fo->opts[k]!='\0'; k++) {                   
                  /* Z compress option is followed by the single-digit compress level */
                  if (fo->opts[k]=='Z') {
+                    done=true;
                     k++;                /* skip option and level */
                  } else {
                     newopts[j] = fo->opts[k];
-                   j++;
+                    j++;
                  }
                }
                newopts[j] = '\0';
 
-               Jmsg(jcr, M_INFO, 0,
-                   _("FD compression disabled for this Job because AllowCompress=No in Storage resource.\n") );
-
+               if (done) {
+                  Jmsg(jcr, M_INFO, 0,
+                      _("FD compression disabled for this Job because AllowCompress=No in Storage resource.\n") );
+               }
                /* Send the new trimmed option set without overwriting fo->opts */
                fd->fsend("O %s\n", newopts);
             } else {