From: Kern Sibbald Date: Thu, 13 Oct 2005 14:22:28 +0000 (+0000) Subject: - Use a bigger buffer 32K as suggested by Arno in bpipe.c. X-Git-Tag: Release-1.38.0~76 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0778d855efc9be0032767d092d2a69f005a80935;p=bacula%2Fbacula - Use a bigger buffer 32K as suggested by Arno in bpipe.c. - Increase dvd mount timeout with patch from Arno. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2437 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index 4f2007903b..bee3634e18 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -5,6 +5,8 @@ General: Changes to 1.37.41: 13Oct05 +- Use a bigger buffer 32K as suggested by Arno in bpipe.c. +- Increase dvd mount timeout with patch from Arno. - Modify DVD code so that it keeps a state flag that indicates when the freespace variable is valid. freespace_errno, now has either 0 or an errno. There are no negative errnos. diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index 03a1ee1a7f..cf505e0584 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -314,6 +314,8 @@ int run_program_full_output(char *prog, int wait, POOLMEM *results) int stat1, stat2; char *mode; POOLMEM* tmp; + char *buf; + const int bufsize = 32000; if (results == NULL) { return run_program(prog, wait, NULL); @@ -322,6 +324,7 @@ int run_program_full_output(char *prog, int wait, POOLMEM *results) sm_check(__FILE__, __LINE__, false); tmp = get_pool_memory(PM_MESSAGE); + buf = (char *)malloc(bufsize+1); mode = (char *)"r"; bpipe = open_bpipe(prog, wait, mode); @@ -335,7 +338,6 @@ int run_program_full_output(char *prog, int wait, POOLMEM *results) sm_check(__FILE__, __LINE__, false); tmp[0] = 0; while (1) { - char buf[1000]; fgets(buf, sizeof(buf), bpipe->rfd); pm_strcat(tmp, buf); if (feof(bpipe->rfd)) { @@ -369,6 +371,7 @@ int run_program_full_output(char *prog, int wait, POOLMEM *results) Dmsg1(900, "Run program returning %d\n", stat); free_pool_memory(tmp); + free(buf); return stat1; } diff --git a/bacula/src/stored/dvd.c b/bacula/src/stored/dvd.c index 15692518a0..21f1d992bb 100644 --- a/bacula/src/stored/dvd.c +++ b/bacula/src/stored/dvd.c @@ -311,11 +311,13 @@ bool dvd_write_part(DCR *dcr) edit_device_codes_dev(dev, ocmd, icmd); /* - * Wait at most the time a maximum size part is written in DVD 0.5x speed - * FIXME: Minimum speed should be in device configuration + * original line follows + * timeout = dev->max_open_wait + (dev->max_part_size/(1350*1024/2)); + * I modified this for a longer timeout; pre-formatting, blanking and + * writing can take quite a while */ - timeout = dev->max_open_wait + (dev->max_part_size/(1350*1024/2)); - + timeout = dev->max_open_wait + (dev->max_part_size/(1350*1024)*8); + Dmsg2(29, "dvd_write_part: cmd=%s timeout=%d\n", ocmd.c_str(), timeout); {