]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bpipe.c
Fix typo.
[bacula/bacula] / bacula / src / lib / bpipe.c
index 5586d6baf7ce6279e6566b27624bdbe75178185b..79a6c0cbceb5de4cb86389cc04217ff177e1129c 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -30,7 +30,6 @@
  *
  *    Kern Sibbald, November MMII
  *
- *   Version $Id$
  */
 
 
@@ -135,7 +134,8 @@ BPIPE *open_bpipe(char *prog, int wait, const char *mode)
          dup2(readp[1], 1);           /* dup our read to his stdout */
          dup2(readp[1], 2);           /*   and his stderr */
       }
-      closelog();                     /* close syslog if open */
+/* Note, the close log cause problems, see bug #1536 */
+/*    closelog();                        close syslog if open */
       for (i=3; i<=32; i++) {         /* close any open file descriptors */
          close(i);
       }
@@ -403,7 +403,8 @@ int run_program_full_output(char *prog, int wait, POOLMEM *&results)
    mode = (char *)"r";
    bpipe = open_bpipe(prog, wait, mode);
    if (!bpipe) {
-      return ENOENT;
+      stat1 = ENOENT;
+      goto bail_out;
    }
    
    sm_check(__FILE__, __LINE__, false);
@@ -449,6 +450,7 @@ int run_program_full_output(char *prog, int wait, POOLMEM *&results)
    stat1 = stat2 != 0 ? stat2 : stat1;
    
    Dmsg1(900, "Run program returning %d\n", stat1);
+bail_out:
    free_pool_memory(tmp);
    free(buf);
    return stat1;