1 --- dvd+rw-tools-6.1.old/growisofs.c 2006-01-26 22:16:54.000000000 +0100
2 +++ dvd+rw-tools-6.1/growisofs.c 2006-02-15 00:00:44.000000000 +0100
4 * - Treat only x73xx OPC errors as fatal;
5 * - Fix typo in -speed scaling code;
6 * - permit tracksize to be not divisible by 32KB in DAO mode;
7 + * 6.1.1: (by Nicolas Boichat, Bacula project)
8 + * - Allow session to cross 4GB boundary regardless of medium type
9 + * (don't need to have a DL media)
10 + * - Add a -F option (used instead of -M or -Z), which displays next_session
11 + * offset and capacity (free space = next_session - capacity).
13 #define PRINT_VERSION(cmd) do { \
14 char *s=strrchr((cmd),'/'); \
15 s ? s++ : (s=(cmd)); \
16 printf ("* %.*sgrowisofs by <appro@fy.chalmers.se>,"\
17 - " version 6.1,\n",(int)(s-(cmd)),(cmd)); \
18 + " version 6.1.1,\n",(int)(s-(cmd)),(cmd)); \
21 #define _LARGEFILE_SOURCE
22 @@ -2329,6 +2334,18 @@
23 else in_device = argv[++i];
26 + else if (argv[i][1] == 'F')
27 + { if (len > 2) in_device = argv[i]+2;
28 + else in_device = argv[++i];
30 + dry_run = 1; /* NEVER write anything with -F */
32 + else if (!strncmp(opt,"-free-space",11))
33 + { if (len > 11) in_device = opt+11;
34 + else in_device = argv[++i];
36 + dry_run = 1; /* NEVER write anything with -F */
38 else if (!strcmp(opt,"-poor-man"))
39 { if (poor_man<0) poor_man = 1;
42 fprintf (stderr," you most likely want to use -Z option.\n"),
43 exit (FATAL_START(errno));
45 - if (dev_found == 'M')
46 + if ((dev_found == 'M') ||
47 + ((dev_found == 'F') && !(mmc_profile&0x10000)) && (saved_descriptors[0].type[0] || saved_descriptors[0].type[1] || saved_descriptors[0].type[2]))
48 + /* -F : The medium is not blank, there is a fs on it (the_buffer[0,1 or 2] != 0), so compute next_session. */
49 { if (memcmp (saved_descriptors[0].type,"\1CD001",6))
50 fprintf (stderr,":-( %s doesn't look like isofs...\n",
51 in_device), exit(FATAL_START(EMEDIUMTYPE));
53 exit(FATAL_START(EINVAL));
55 else if (next_session > (0x200000-0x5000)) /* 4GB/2K-40MB/2K */
56 - if ((mmc_profile&0xFFFF)!=0x2B || !no_4gb_check)
58 fprintf (stderr,":-( next session would cross 4GB "
59 "boundary, aborting...\n"),
60 exit (FATAL_START(ENOSPC));
62 exit (FATAL_START(EINVAL));
65 - { if (mkisofs_argc==1)
66 + { if ((mkisofs_argc==1) && (dev_found != 'F'))
67 fprintf (stderr,"%s: no mkisofs options specified, "
68 "aborting...\n",argv[0]),
69 exit (FATAL_START(EINVAL));
70 @@ -2880,6 +2899,15 @@
74 + if (dev_found == 'F') {
75 + off64_t capacity = 0;
76 + printf("next_session=%lld\n", next_session*CD_BLOCK);
77 + if (ioctl_handle!=INVALID_HANDLE)
78 + capacity = get_capacity (ioctl_handle);
79 + printf("capacity=%lld\n", capacity);
85 if (builtin_dd (imgfd,out_fd,next_session*CD_BLOCK) < 0)