1 diff -u dvd+rw-tools-5.21.4.10.8/growisofs.c dvd+rw-tools-5.22/growisofs.c
2 --- dvd+rw-tools-5.21.4.10.8/growisofs.c 2004-08-25 01:02:29.000000000 +0200
3 +++ dvd+rw-tools-5.22/growisofs.c 2005-10-16 22:48:02.000000000 +0200
5 * - Linux: fix for kernel version 2.6>=8, 2.6.8 itself is deficient,
6 * but the problem can be worked around by installing this version
8 + * 5.22: (by Nicolas Boichat, Bacula project)
9 + * - Allow session to cross 4GB boundary regardless of medium type
10 + * (don't need to have a DL media)
11 + * - Add a -F option (used instead of -M or -Z), which displays next_session
12 + * offset and capacity (free space = next_session - capacity).
14 #define PRINT_VERSION(cmd) do { \
15 char *s=strrchr((cmd),'/'); \
16 s ? s++ : (s=(cmd)); \
17 printf ("* %.*sgrowisofs by <appro@fy.chalmers.se>,"\
18 - " version 5.21,\n",(int)(s-(cmd)),(cmd)); \
19 + " version 5.22,\n",(int)(s-(cmd)),(cmd)); \
22 #define _LARGEFILE_SOURCE
23 @@ -1720,6 +1725,18 @@
24 else in_device = argv[++i];
27 + else if (argv[i][1] == 'F')
28 + { if (len > 2) in_device = argv[i]+2;
29 + else in_device = argv[++i];
31 + dry_run = 1; /* NEVER write anything with -F */
33 + else if (!strncmp(opt,"-free-space",11))
34 + { if (len > 11) in_device = opt+11;
35 + else in_device = argv[++i];
37 + dry_run = 1; /* NEVER write anything with -F */
39 else if (!strcmp(opt,"-poor-man"))
40 { if (poor_man<0) poor_man = 1;
43 fprintf (stderr," you most likely want to use -Z option.\n"),
44 exit (FATAL_START(errno));
46 - if (dev_found == 'M')
47 + if ((dev_found == 'M') ||
48 + ((dev_found == 'F') && !(mmc_profile&0x10000)) && (the_buffer[0] || the_buffer[1] || the_buffer[2]))
49 + /* -F : The medium is not blank, there is a fs on it (the_buffer[0,1 or 2] != 0), so compute next_session. */
50 { if (memcmp (the_buffer,"\1CD001",6))
51 fprintf (stderr,":-( %s doesn't look like isofs...\n",
52 in_device), exit(FATAL_START(EMEDIUMTYPE));
54 exit(FATAL_START(EINVAL));
56 else if (next_session > (0x200000-0x5000)) /* 4GB/2K-40MB/2K */
57 - if ((mmc_profile&0xFFFF)!=0x2B || !no_4gb_check)
59 fprintf (stderr,":-( next session would cross 4GB "
60 "boundary, aborting...\n"),
61 exit (FATAL_START(ENOSPC));
63 exit (FATAL_START(EINVAL));
66 - { if (mkisofs_argc==1)
67 + { if ((mkisofs_argc==1) && (dev_found != 'F'))
68 fprintf (stderr,"%s: no mkisofs options specified, "
69 "aborting...\n",argv[0]),
70 exit (FATAL_START(EINVAL));
71 @@ -2114,6 +2133,15 @@
75 + if (dev_found == 'F') {
76 + off64_t capacity = 0;
77 + printf("next_session=%lld\n", next_session*CD_BLOCK);
78 + if (ioctl_handle!=INVALID_HANDLE)
79 + capacity = get_capacity (ioctl_handle);
80 + printf("capacity=%lld\n", capacity);
86 if (builtin_dd (imgfd,out_fd,next_session*CD_BLOCK) < 0)