[BACK]Return to cdio.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cdio

Diff for /src/usr.bin/cdio/cdio.c between version 1.49 and 1.50

version 1.49, 2006/06/01 06:32:17 version 1.50, 2006/06/01 07:12:18
Line 226 
Line 226 
         struct stat sb;          struct stat sb;
         struct track_info *cur_track;          struct track_info *cur_track;
         struct track_info *tr;          struct track_info *tr;
           off_t availblk,needblk = 0;
           u_int blklen;
           u_int ntracks = 0;
         char type;          char type;
   
         cdname = getenv("DISC");          cdname = getenv("DISC");
Line 271 
Line 274 
                         usage();                          usage();
                 SLIST_INIT(&tracks);                  SLIST_INIT(&tracks);
                 type = 'd';                  type = 'd';
                   blklen = 2048;
                 while (argc > 1) {                  while (argc > 1) {
                         tr = malloc(sizeof(struct track_info));                          tr = malloc(sizeof(struct track_info));
                         tr->type = type;                          tr->type = type;
Line 280 
Line 284 
                                 switch (ch) {                                  switch (ch) {
                                 case 'a':                                  case 'a':
                                         type = 'a';                                          type = 'a';
                                           blklen = 2352;
                                         break;                                          break;
                                 case 'd':                                  case 'd':
                                         type = 'd';                                          type = 'd';
                                           blklen = 2048;
                                         break;                                          break;
                                 default:                                  default:
                                         usage();                                          usage();
                                 }                                  }
                         }                          }
                         tr->type = type;                          tr->type = type;
                           tr->blklen = blklen;
                         argc -= optind;                          argc -= optind;
                         argv += optind;                          argv += optind;
                         if (argv[0] == NULL)                          if (argv[0] == NULL)
Line 299 
Line 306 
                                 return (-1);                                  return (-1);
                         }                          }
                         tr->sz = sb.st_size;                          tr->sz = sb.st_size;
                           if (tr->type == 'a')
                                   tr->sz -= WAVHDRLEN;
                         if (SLIST_EMPTY(&tracks))                          if (SLIST_EMPTY(&tracks))
                                 SLIST_INSERT_HEAD(&tracks,tr,track_list);                                  SLIST_INSERT_HEAD(&tracks,tr,track_list);
                         else                          else
Line 307 
Line 316 
                 }                  }
                 if (! open_cd(cdname, 1))                  if (! open_cd(cdname, 1))
                         exit(1);                          exit(1);
                   get_disc_size(&availblk);
                   SLIST_FOREACH(tr, &tracks, track_list) {
                           needblk += tr->sz/tr->blklen;
                           ntracks++;
                   }
                   needblk += (ntracks - 1) * 150; /* transition area between tracks */
                   if (needblk > availblk)
                           errx(1,"Only %llu of the required %llu blocks available",
                                availblk,needblk);
                 if (writetao(&tracks) != 0)                  if (writetao(&tracks) != 0)
                         exit(1);                          exit(1);
                 else                  else

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50