]> git.sur5r.net Git - bacula/bacula/commitdiff
Make sure that bpipe results are zapped even on
authorKern Sibbald <kern@sibbald.com>
Mon, 11 Jul 2005 20:07:24 +0000 (20:07 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 11 Jul 2005 20:07:24 +0000 (20:07 +0000)
  error return.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2190 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kes-1.37
bacula/src/lib/bpipe.c

index 0967cdf55ff2af43f7db6b83ee6ac6d182c36275..10716a582844b33f9096b75ab6d3adf17c5ebc65 100644 (file)
@@ -5,6 +5,8 @@ General:
 
 Changes to 1.37.28:
 11Jul05
+- Make sure that bpipe results are zapped even on
+  error return.
 - Lots of documentation.
 - Do not prune volume marked as append when needing a
   new Volume.
index 1002e70ba616689c37be3bd19438e7edaf14fe3a..4a9eb978873b1d50762a02447f418b233f347564 100644 (file)
@@ -255,13 +255,15 @@ int run_program(char *prog, int wait, POOLMEM *results)
    int stat1, stat2;
    char *mode;
 
+   if (results) {
+      results[0] = 0;
+   }
    mode = (char *)(results != NULL ? "r" : "");
    bpipe = open_bpipe(prog, wait, mode);
    if (!bpipe) {
       return ENOENT;
    }
    if (results) {
-      results[0] = 0;
       fgets(results, sizeof_pool_memory(results), bpipe->rfd);
       if (feof(bpipe->rfd)) {
          stat1 = 0;