]> git.sur5r.net Git - bacula/bacula/commitdiff
- Use a bigger buffer 32K as suggested by Arno in bpipe.c.
authorKern Sibbald <kern@sibbald.com>
Thu, 13 Oct 2005 14:22:28 +0000 (14:22 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 13 Oct 2005 14:22:28 +0000 (14:22 +0000)
- 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

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

index 4f2007903b2d179aa0f4ed16f48287cdd777f573..bee3634e18edec64fa28b81feb6550f98ce0a62c 100644 (file)
@@ -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.
index 03a1ee1a7f0e766b8dfb5f053d1f7f1ab0205605..cf505e05840126d0ce56249b810caa341db1b62b 100644 (file)
@@ -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;
 }
 
index 15692518a0004adc5cb7f0011d8d2b0a7ce7fa02..21f1d992bb6e63455e8cdaf27c9ac7fab9c32ce0 100644 (file)
@@ -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);
       
    {