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.
int stat1, stat2;
char *mode;
POOLMEM* tmp;
+ char *buf;
+ const int bufsize = 32000;
if (results == NULL) {
return run_program(prog, wait, NULL);
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);
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)) {
Dmsg1(900, "Run program returning %d\n", stat);
free_pool_memory(tmp);
+ free(buf);
return stat1;
}
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);
{