Compare commits
86 Commits
ZeroNineZe
...
1.1.0
Author | SHA1 | Date | |
---|---|---|---|
91adddd7b0 | |||
3cf354654e | |||
0698621318 | |||
9727bb8fc4 | |||
4abf2b75b1 | |||
f93babeea6 | |||
54723c9ee3 | |||
75f121d26e | |||
9ee4f65141 | |||
8d057e4ee4 | |||
47af302776 | |||
c96745af15 | |||
99af1501fc | |||
aeff7957f2 | |||
5f743b8030 | |||
27997067c9 | |||
cf8e46ec32 | |||
bad7a81d0d | |||
5e8e73d994 | |||
5ba8c03a98 | |||
096ed00f2e | |||
b4aeba18f7 | |||
0352486f97 | |||
edd131b1b9 | |||
30f3f70dfd | |||
806b9602e6 | |||
f116eeec64 | |||
7e50165d5c | |||
46357869fc | |||
f85cb8269f | |||
8fffc74a5b | |||
8fd81d4ec4 | |||
0c76daf2a9 | |||
86656a9d52 | |||
95e511b984 | |||
7af151169d | |||
7a9a7dfdd2 | |||
0ac6a64f12 | |||
8bd288e10c | |||
28078d059a | |||
ac665916a6 | |||
e9637067f8 | |||
a058e24375 | |||
f895077c3c | |||
73423b8819 | |||
5e9c7bac3f | |||
e32bd99801 | |||
e86a7f9880 | |||
9c9b82ae61 | |||
d5cc482015 | |||
1f14074d59 | |||
d0c6889603 | |||
a088a85374 | |||
a3ac6c63aa | |||
af41742516 | |||
998fcdbefa | |||
ed811f45e6 | |||
240e6abff4 | |||
402f4c0b04 | |||
1b166f484d | |||
b945974dc7 | |||
cf214650c6 | |||
69ec9334d1 | |||
238fde4ef1 | |||
69e95016fb | |||
a8e54b86d7 | |||
9f5e967bdf | |||
fcaf3e9d9a | |||
b59429c568 | |||
1f72fe107d | |||
043d9a82d8 | |||
952c9b0432 | |||
4f5075d7a9 | |||
2b07bd0632 | |||
0a714850d7 | |||
3caf176aeb | |||
43f7e7d063 | |||
447a68d691 | |||
0a3b34d9c1 | |||
0b25a4d258 | |||
3b5aeb0f81 | |||
5ec4a7419e | |||
bf7e4c8027 | |||
682078575f | |||
43f3d4b70f | |||
523b59984b |
@ -1,7 +1,7 @@
|
||||
Derek Foreman <derek@signalmarketing.com> and Ben Jansens <xor@orodu.net>
|
||||
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
Mario Danic <mario.danic@gmail.com>, Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2011 Mario Danic, Thomas Schmitt
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
30
ChangeLog
30
ChangeLog
@ -1,6 +1,32 @@
|
||||
SVN trunk (to become libburn-0.9.2.pl00.tar.gz)
|
||||
|
||||
libburn-1.1.0.tar.gz Sat Jun 18 2011
|
||||
===============================================================================
|
||||
- no novelties yet
|
||||
* Bug fix: burn_disc_format() on DVD-RW issued wrong block size with type 00h
|
||||
* New API call burn_disc_next_track_is_damaged()
|
||||
* New API call burn_disc_close_damaged()
|
||||
* Dropped suffix .plXY from tarball name
|
||||
|
||||
Release 1.0.8 was skipped to get back in sync with libisofs and libisoburn.
|
||||
|
||||
libburn-1.0.6.pl00.tar.gz Sat Apr 9 2011
|
||||
===============================================================================
|
||||
* Burning DVD-R DAO with 2 kB size granularity rather than 32 kB
|
||||
* New API call burn_allow_drive_role_4()
|
||||
|
||||
libburn-1.0.4.pl00.tar.gz Thu Mar 3 2011
|
||||
===============================================================================
|
||||
* Bug fix: Read-only file descriptors were classified as write-only pseudo
|
||||
drives
|
||||
|
||||
libburn-1.0.2.pl00.tar.gz Wed Feb 23 2011
|
||||
===============================================================================
|
||||
* Removed compilation obstacles on Solaris 9.
|
||||
* Improved recognition of non-seekable stdio pseudo-drives.
|
||||
|
||||
libburn-1.0.0.pl00.tar.gz Sun Jan 16 2011
|
||||
===============================================================================
|
||||
* Allowed umask to create stdio-drive files with rw-permissions for all
|
||||
* cdrskin now refuses to burn if the foreseeable size exceeds media capacity
|
||||
|
||||
libburn-0.9.0.pl00.tar.gz Wed Dec 08 2010
|
||||
===============================================================================
|
||||
|
@ -6,6 +6,7 @@ pkgconfigdir=$(LIBBURNIA_PKGCONFDIR)
|
||||
libincludedir=$(includedir)/libburn
|
||||
|
||||
lib_LTLIBRARIES = libburn/libburn.la
|
||||
ACLOCAL_AMFLAGS = -I ./
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
@ -117,9 +118,9 @@ test_structest_CPPFLAGS = -Ilibburn
|
||||
test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
|
||||
test_structest_SOURCES = test/structest.c
|
||||
|
||||
## cdrskin construction site - ts A60816 - B01208
|
||||
## cdrskin construction site - ts A60816 - B10409
|
||||
cdrskin_cdrskin_CPPFLAGS = -Ilibburn
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_9_0
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_1_1_0
|
||||
|
||||
# cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
|
||||
# ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking
|
||||
@ -196,6 +197,8 @@ EXTRA_DIST = \
|
||||
version.h.in \
|
||||
doc/comments \
|
||||
doc/doxygen.conf.in \
|
||||
doc/cookbook.txt \
|
||||
doc/mediainfo.txt \
|
||||
README \
|
||||
AUTHORS \
|
||||
CONTRIBUTORS \
|
||||
|
62
README
62
README
@ -6,12 +6,12 @@ This all is under GPL.
|
||||
------------------------------------------------------------------------------
|
||||
libburn-project.org
|
||||
By Mario Danic <mario.danic@gmail.com> and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2011 Mario Danic, Thomas Schmitt
|
||||
Still containing parts of Libburn. By Derek Foreman <derek@signalmarketing.com>
|
||||
and Ben Jansens <xor@orodu.net>
|
||||
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
|
||||
http://files.libburnia-project.org/releases/libburn-0.9.0.pl00.tar.gz
|
||||
http://files.libburnia-project.org/releases/libburn-1.1.0.tar.gz
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@ -19,10 +19,10 @@ Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
|
||||
From tarball
|
||||
|
||||
Obtain libburn-0.9.0.pl00.tar.gz, take it to a directory of your choice and do:
|
||||
Obtain libburn-1.1.0.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf libburn-0.9.0.pl00.tar.gz
|
||||
cd libburn-0.9.0
|
||||
tar xzf libburn-1.1.0.tar.gz
|
||||
cd libburn-1.1.0
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
@ -573,8 +573,58 @@ Project history as far as known to me:
|
||||
- Tue Oct 26 2010 Release 0.6.4.pl00 of libisoburn and xorriso makes use of
|
||||
the new libisofs capabilities.
|
||||
|
||||
- Wed Dec 08 libburn-0.9.0 fixes a regression with SCSI command logging.
|
||||
- Wed Dec 08 2010 libburn-0.9.0 fixes a regression with SCSI command logging.
|
||||
|
||||
- Fri Dec 10 2010 Version 0.6.40 of libisofs makes the prediction of the
|
||||
emerging image size less expensive and is able to make images bootable
|
||||
for SUN SPARC systems.
|
||||
|
||||
- Sun Dec 12 2010 Release 0.6.6.pl00 of libisoburn and xorriso can read ISO
|
||||
images which were copied to a different start address than they were prepared
|
||||
for.
|
||||
|
||||
- Mon Jan 17 2011 we go for release 1.0.0. This does not indicate a
|
||||
technological overhaul but shall emphasize the maturity of the software.
|
||||
libisofs-1.0.0 fixes a bug about the length of ECMA-119 directory names and
|
||||
is ready to allow untranslated ECMA-119 names (violating the specs).
|
||||
libburn-1.0.0.pl00 allows umask to create stdio-drive files with
|
||||
rw-permissions for all. cdrskin now refuses to burn if the foreseeable size
|
||||
exceeds media capacity
|
||||
libisoburn-1.0.0.pl00 allows to create an ISO 9660:1999 directory tree,
|
||||
improved the emulation fidelity of command -as mkisofs, lowered the default
|
||||
abort threshold for xorriso batch mode, and increased that threshold for
|
||||
xorriso dialog mode.
|
||||
|
||||
- Wed Feb 23 2011 release 1.0.2:
|
||||
libisofs fixes several bugs and introduces the capability to copy files
|
||||
inside the ISO filesystem.
|
||||
libburn removed a compilation obstacle on Solaris 9 and improved recognition
|
||||
of stdio pseudo-drives.
|
||||
libisoburn and xorriso fix bugs and make use of the new libisofs capability.
|
||||
xorriso improves its mkisofs emulation.
|
||||
|
||||
- Thu Mar 10 2011 release 1.0.4:
|
||||
Several bugs were fixed in the libraries and in the mkisofs emulation of
|
||||
xorriso. This emulation xorrisofs has now an own man page and info document.
|
||||
|
||||
- Sat Apr 09 2011 release 1.0.6:
|
||||
libburn refined its representation of emulated drives. The size alignment
|
||||
of DVD DAO is now 2 kB rather than 32 kB. libisofs produces Joliet names of
|
||||
up to 103 characters. xorriso fixes two bugs and makes use of the library
|
||||
improvements.
|
||||
|
||||
- Thu Apr 14 2011 release libisoburn-1.0.8:
|
||||
A bug in the mkisofs emulation of xorriso could cause options to be ignored.
|
||||
The problem was freshly introduced with libisoburn-1.0.6.
|
||||
|
||||
- Fri May 13 2011 release libisofs-1.0.8:
|
||||
Fixes a few rarely occurring bugs that have been found during the last month.
|
||||
|
||||
- Sat Jun 18 2011 release 1.1.0:
|
||||
The consumption of stack memory was reduced. Statical program analysis found
|
||||
some rarely occuring memory leaks. Several small bugs were fixed.
|
||||
The suffix .plXY was dropped from tarball names of libburn and libisoburn.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
aclocal
|
||||
aclocal -I .
|
||||
libtoolize --copy --force
|
||||
autoconf
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
cdrskin. By Thomas Schmitt <scdbackup@gmx.net>
|
||||
Integrated sub project of libburnia-project.org but also published via:
|
||||
http://scdbackup.sourceforge.net/cdrskin_eng.html
|
||||
http://scdbackup.sourceforge.net/cdrskin-0.9.0.pl00.tar.gz
|
||||
http://scdbackup.sourceforge.net/cdrskin-1.1.0.tar.gz
|
||||
|
||||
Copyright (C) 2006-2010 Thomas Schmitt, provided under GPL version 2 or later.
|
||||
Copyright (C) 2006-2011 Thomas Schmitt, provided under GPL version 2 or later.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -26,10 +26,10 @@ By using this software you agree to the disclaimer at the end of this text
|
||||
|
||||
Compilation, First Glimpse, Installation
|
||||
|
||||
Obtain cdrskin-0.9.0.pl00.tar.gz, take it to a directory of your choice and do:
|
||||
Obtain cdrskin-1.1.0.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf cdrskin-0.9.0.pl00.tar.gz
|
||||
cd cdrskin-0.9.0
|
||||
tar xzf cdrskin-1.1.0.tar.gz
|
||||
cd cdrskin-1.1.0
|
||||
|
||||
Within that directory execute:
|
||||
|
||||
|
@ -38,8 +38,9 @@ original="./libburn_svn_release.tgz"
|
||||
# My changes are in $changes , mainly in $changes/cdrskin
|
||||
changes="./libburn-release"
|
||||
|
||||
skin_release="0.9.0"
|
||||
patch_level=".pl00"
|
||||
skin_release="1.1.0"
|
||||
patch_level=""
|
||||
# patch_level=".pl00"
|
||||
skin_rev="$skin_release""$patch_level"
|
||||
|
||||
# The result directory and the name of the result tarballs
|
@ -38,7 +38,7 @@ original="./libburn_svn.tgz"
|
||||
# My changes are in $changes , mainly in $changes/cdrskin
|
||||
changes="./libburn-develop"
|
||||
|
||||
skin_release="0.9.1"
|
||||
skin_release="1.1.1"
|
||||
patch_level=""
|
||||
skin_rev="$skin_release""$patch_level"
|
||||
|
@ -2,7 +2,7 @@
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH CDRSKIN 1 "Aug 21, 2010"
|
||||
.TH CDRSKIN 1 "Jan 09, 2011"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
@ -554,6 +554,9 @@ which appear to be in the desired blank or format state already.
|
||||
This option enables a burn run with option -dummy even if libburn believes
|
||||
that drive and media will not simulate the write mode but will write for real.
|
||||
.br
|
||||
It enables a burn run where cdrskin expects to exceed the available media
|
||||
capacity.
|
||||
.br
|
||||
.B Caution:
|
||||
Use this only when in urgent need.
|
||||
.TP
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
cdrskin.c , Copyright 2006-2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
cdrskin.c , Copyright 2006-2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
A cdrecord compatible command line interface for libburn.
|
||||
@ -88,17 +88,17 @@ or
|
||||
|
||||
/** The official program version */
|
||||
#ifndef Cdrskin_prog_versioN
|
||||
#define Cdrskin_prog_versioN "0.9.0"
|
||||
#define Cdrskin_prog_versioN "1.1.0"
|
||||
#endif
|
||||
|
||||
/** The official libburn interface revision to use.
|
||||
(May get changed further below)
|
||||
*/
|
||||
#ifndef Cdrskin_libburn_majoR
|
||||
#define Cdrskin_libburn_majoR 0
|
||||
#define Cdrskin_libburn_majoR 1
|
||||
#endif
|
||||
#ifndef Cdrskin_libburn_minoR
|
||||
#define Cdrskin_libburn_minoR 9
|
||||
#define Cdrskin_libburn_minoR 1
|
||||
#endif
|
||||
#ifndef Cdrskin_libburn_micrO
|
||||
#define Cdrskin_libburn_micrO 0
|
||||
@ -135,46 +135,42 @@ or
|
||||
#endif /* Cdrskin_libburn_cvs_A60220_tS */
|
||||
|
||||
|
||||
#ifdef Cdrskin_libburn_0_9_0
|
||||
#define Cdrskin_libburn_versioN "0.9.0"
|
||||
#ifdef Cdrskin_libburn_1_1_0
|
||||
#define Cdrskin_libburn_versioN "1.1.0"
|
||||
#define Cdrskin_libburn_from_pykix_svN 1
|
||||
#endif /* Cdrskin_libburn_0_9_0 */
|
||||
#endif
|
||||
|
||||
#ifdef Cdrskin_libburn_0_9_1
|
||||
#define Cdrskin_libburn_versioN "0.9.1"
|
||||
#ifdef Cdrskin_libburn_1_1_1
|
||||
#define Cdrskin_libburn_versioN "1.1.1"
|
||||
#define Cdrskin_libburn_from_pykix_svN 1
|
||||
|
||||
/* Place novelty switch macros here.
|
||||
Move them down to Cdrskin_libburn_from_pykix_svN on version leap
|
||||
*/
|
||||
|
||||
/* Do not stay in signal handler but only cancel and set Cdrskin_abort_leveL.
|
||||
Make use of burn_is_aborting() to detect pending libburn aborts.
|
||||
*/
|
||||
|
||||
|
||||
#endif /* Cdrskin_libburn_0_9_1 */
|
||||
#endif /* Cdrskin_libburn_1_1_1 */
|
||||
|
||||
#ifndef Cdrskin_libburn_versioN
|
||||
#define Cdrskin_libburn_0_9_0
|
||||
#define Cdrskin_libburn_versioN "0.9.0"
|
||||
#define Cdrskin_libburn_1_1_1
|
||||
#define Cdrskin_libburn_versioN "1.1.1"
|
||||
#define Cdrskin_libburn_from_pykix_svN 1
|
||||
#endif
|
||||
|
||||
#ifdef Cdrskin_libburn_0_9_0
|
||||
#ifdef Cdrskin_libburn_1_1_0
|
||||
#undef Cdrskin_libburn_majoR
|
||||
#undef Cdrskin_libburn_minoR
|
||||
#undef Cdrskin_libburn_micrO
|
||||
#define Cdrskin_libburn_majoR 0
|
||||
#define Cdrskin_libburn_minoR 9
|
||||
#define Cdrskin_libburn_majoR 1
|
||||
#define Cdrskin_libburn_minoR 1
|
||||
#define Cdrskin_libburn_micrO 0
|
||||
#endif
|
||||
#ifdef Cdrskin_libburn_0_9_1
|
||||
#ifdef Cdrskin_libburn_1_1_1
|
||||
#undef Cdrskin_libburn_majoR
|
||||
#undef Cdrskin_libburn_minoR
|
||||
#undef Cdrskin_libburn_micrO
|
||||
#define Cdrskin_libburn_majoR 0
|
||||
#define Cdrskin_libburn_minoR 9
|
||||
#define Cdrskin_libburn_majoR 1
|
||||
#define Cdrskin_libburn_minoR 1
|
||||
#define Cdrskin_libburn_micrO 1
|
||||
#endif
|
||||
|
||||
@ -652,7 +648,7 @@ int Sfile_home_adr_s(char *filename, char *fileadr, int fa_size, int flag)
|
||||
home= getenv("HOME");
|
||||
if(home==NULL)
|
||||
return(0);
|
||||
if(strlen(home)+strlen(filename)+1>=fa_size)
|
||||
if((int) (strlen(home) + strlen(filename) + 1) >= fa_size)
|
||||
return(-1);
|
||||
strcpy(fileadr,home);
|
||||
if(filename[0]!=0){
|
||||
@ -2221,6 +2217,7 @@ LIBBURN_MISCONFIGURATION_ = 0;
|
||||
return(-1);
|
||||
}
|
||||
Cdrpreskin_set_severities(preskin,NULL,NULL,0);
|
||||
burn_allow_drive_role_4(1);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@ -3171,7 +3168,7 @@ set_severities:;
|
||||
int major, minor, micro;
|
||||
|
||||
printf(
|
||||
"Cdrecord 2.01-Emulation Copyright (C) 2006-2010, see libburnia-project.org\n");
|
||||
"Cdrecord 2.01-Emulation Copyright (C) 2006-2011, see libburnia-project.org\n");
|
||||
if(o->fallback_program[0]) {
|
||||
char *hargv[2];
|
||||
|
||||
@ -3753,7 +3750,7 @@ int Cdrskin_get_device_adr(struct CdrskiN *skin,
|
||||
|
||||
int Cdrskin_get_drive(struct CdrskiN *skin, struct burn_drive **drive,int flag)
|
||||
{
|
||||
if(skin->driveno<0 || skin->driveno >= skin->n_drives)
|
||||
if(skin->driveno<0 || (unsigned int) skin->driveno >= skin->n_drives)
|
||||
return(0);
|
||||
*drive= skin->drives[skin->driveno].drive;
|
||||
return ((*drive) != NULL);
|
||||
@ -4017,7 +4014,7 @@ int Cdrskin_grab_drive(struct CdrskiN *skin, int flag)
|
||||
ClN(fprintf(stderr,
|
||||
"cdrskin_debug: Cdrskin_grab_drive() dropping unwanted drives (%d)\n",
|
||||
skin->n_drives-1));
|
||||
for(i=0;i<skin->n_drives;i++) {
|
||||
for(i= 0; i < (int) skin->n_drives; i++) {
|
||||
if(i==skin->driveno)
|
||||
continue;
|
||||
if(skin->verbosity>=Cdrskin_verbose_debuG)
|
||||
@ -4360,7 +4357,7 @@ int Cdrskin_driveno_of_location(struct CdrskiN *skin, char *devicename,
|
||||
int i,ret;
|
||||
char adr[Cdrskin_adrleN];
|
||||
|
||||
for(i=0;i<skin->n_drives;i++) {
|
||||
for(i= 0; i < (int) skin->n_drives; i++) {
|
||||
|
||||
#ifdef Cdrskin_libburn_has_drive_get_adR
|
||||
ret= burn_drive_get_adr(&(skin->drives[i]), adr);
|
||||
@ -4450,7 +4447,7 @@ wrong_devno:;
|
||||
goto location_not_found;
|
||||
}
|
||||
}
|
||||
if((*driveno)>=skin->n_drives || (*driveno)<0) {
|
||||
if((unsigned int) (*driveno) >= skin->n_drives || (*driveno) < 0) {
|
||||
ClN(fprintf(stderr,"cdrskin: obtained drive number %d from '%s'\n",
|
||||
*driveno,adr));
|
||||
goto wrong_devno;
|
||||
@ -4476,7 +4473,7 @@ int Cdrskin_driveno_to_btldev(struct CdrskiN *skin, int driveno,
|
||||
int k,ret,still_untranslated= 1,hret,k_start;
|
||||
char *loc= NULL,buf[Cdrskin_adrleN],adr[Cdrskin_adrleN];
|
||||
|
||||
if(driveno<0 || driveno>skin->n_drives)
|
||||
if(driveno < 0 || driveno > (int) skin->n_drives)
|
||||
goto fallback;
|
||||
|
||||
#ifdef Cdrskin_libburn_has_drive_get_adR
|
||||
@ -4745,13 +4742,13 @@ int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
|
||||
drives_busses= calloc((skin->n_drives+1), sizeof(int));
|
||||
if(drives_shown == NULL || drives_busses == NULL)
|
||||
{ret= -1; goto ex;}
|
||||
for(i=0;i<skin->n_drives;i++)
|
||||
for(i= 0; i < (int) skin->n_drives; i++)
|
||||
drives_shown[i]= 0;
|
||||
if(flag&1) {
|
||||
printf("cdrskin: Overview of accessible drives (%d found) :\n",
|
||||
skin->n_drives);
|
||||
printf("-----------------------------------------------------------------------------\n");
|
||||
for(i=0;i<skin->n_drives;i++) {
|
||||
for(i= 0; i < (int) skin->n_drives; i++) {
|
||||
|
||||
#ifdef Cdrskin_libburn_has_drive_get_adR
|
||||
ret= burn_drive_get_adr(&(skin->drives[i]), adr);
|
||||
@ -4801,7 +4798,7 @@ int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
|
||||
if(skin->preskin->old_pseudo_scsi_adr)
|
||||
printf("cdrskin: NOTE : The printed addresses are not cdrecord compatible !\n");
|
||||
|
||||
for(i=0;i<skin->n_drives;i++) {
|
||||
for(i= 0; i < (int) skin->n_drives; i++) {
|
||||
drives_busses[i]= -1;
|
||||
ret= Cdrskin_driveno_to_btldev(skin,i,btldev,1);
|
||||
if(ret >= pseudo_transport_group &&
|
||||
@ -4811,8 +4808,8 @@ int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
|
||||
busmax= 1 + ret - pseudo_transport_group;
|
||||
}
|
||||
}
|
||||
for(busidx= 0; busidx < skin->n_drives + 1; busidx++) {
|
||||
if(busidx < skin->n_drives)
|
||||
for(busidx= 0; busidx < (int) skin->n_drives + 1; busidx++) {
|
||||
if(busidx < (int) skin->n_drives)
|
||||
busno= drives_busses[busidx];
|
||||
else
|
||||
busno= busmax;
|
||||
@ -4824,7 +4821,7 @@ int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
|
||||
if(i < busidx)
|
||||
continue;
|
||||
first_on_bus= 1;
|
||||
for(i=0;i<skin->n_drives;i++) {
|
||||
for(i= 0; i < (int) skin->n_drives; i++) {
|
||||
ret= Cdrskin_driveno_to_btldev(skin,i,btldev,1);
|
||||
if(busno==busmax && drives_shown[i]==0) {
|
||||
if(ret/1000000 != pseudo_transport_group) {
|
||||
@ -4883,7 +4880,7 @@ int Cdrskin_checkdrive(struct CdrskiN *skin, char *profile_name, int flag)
|
||||
else
|
||||
ClN(printf("cdrskin: pseudo-checkdrive on drive %d\n",skin->driveno));
|
||||
}
|
||||
if(skin->driveno>=skin->n_drives || skin->driveno<0) {
|
||||
if(skin->driveno >= (int) skin->n_drives || skin->driveno < 0) {
|
||||
fprintf(stderr,"cdrskin: FATAL : there is no drive #%d\n",skin->driveno);
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||
@ -4900,6 +4897,10 @@ int Cdrskin_checkdrive(struct CdrskiN *skin, char *profile_name, int flag)
|
||||
printf("%s\n","Emulated (stdio-drive, 2k random read-write)");
|
||||
else if(ret==3)
|
||||
printf("%s\n","Emulated (stdio-drive, sequential write-only)");
|
||||
else if(ret==4)
|
||||
printf("%s\n","Emulated (stdio-drive, 2k random read-only)");
|
||||
else if(ret == 5)
|
||||
printf("%s\n","Emulated (stdio-drive, 2k random write-only)");
|
||||
else if(ret!=1)
|
||||
printf("%s\n","Emulated (stdio-drive)");
|
||||
else
|
||||
@ -7081,6 +7082,10 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
|
||||
double put_counter, get_counter, empty_counter, full_counter;
|
||||
int total_min_fill, fifo_percent;
|
||||
#endif
|
||||
#ifdef Cdrskin_libburn_has_get_spacE
|
||||
off_t free_space;
|
||||
char msg[80];
|
||||
#endif
|
||||
|
||||
if(skin->tell_media_space)
|
||||
doing= "estimating";
|
||||
@ -7324,17 +7329,12 @@ burn_failed:;
|
||||
/* write capacity estimation and return without actual burning */
|
||||
|
||||
#ifdef Cdrskin_libburn_has_get_spacE
|
||||
{
|
||||
off_t free_space;
|
||||
char msg[80];
|
||||
|
||||
free_space= burn_disc_available_space(drive,o);
|
||||
sprintf(msg,"%d\n",(int) (free_space/(off_t) 2048));
|
||||
if(skin->preskin->result_fd>=0) {
|
||||
write(skin->preskin->result_fd,msg,strlen(msg));
|
||||
} else
|
||||
printf("%s",msg);
|
||||
}
|
||||
free_space= burn_disc_available_space(drive,o);
|
||||
sprintf(msg,"%d\n",(int) (free_space/(off_t) 2048));
|
||||
if(skin->preskin->result_fd>=0) {
|
||||
write(skin->preskin->result_fd,msg,strlen(msg));
|
||||
} else
|
||||
printf("%s",msg);
|
||||
#endif /* Cdrskin_libburn_has_get_spacE */
|
||||
|
||||
if(skin->track_counter>0)
|
||||
@ -7344,6 +7344,23 @@ burn_failed:;
|
||||
{ret= 1; goto ex;}
|
||||
}
|
||||
|
||||
|
||||
#ifdef Cdrskin_libburn_has_get_spacE
|
||||
if(skin->fixed_size > 0 && !skin->force_is_set) {
|
||||
free_space= burn_disc_available_space(drive,o);
|
||||
if(skin->fixed_size > free_space && free_space > 0) {
|
||||
fprintf(stderr,
|
||||
"cdrskin: FATAL : predicted session size %lus does not fit on media (%lus)\n",
|
||||
(unsigned long) ((skin->fixed_size + 2047.0) / 2048.0),
|
||||
(unsigned long) ((free_space + 2047) / 2048));
|
||||
ClN(fprintf(stderr,
|
||||
"cdrskin: HINT : This test may be disabled by option -force\n");)
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||
}
|
||||
#endif /* Cdrskin_libburn_has_get_spacE */
|
||||
|
||||
|
||||
Cdrskin_adjust_speed(skin,0);
|
||||
|
||||
#ifndef Cdrskin_extra_leaN
|
||||
@ -7746,7 +7763,7 @@ int Cdrskin_eject(struct CdrskiN *skin, int flag)
|
||||
if(!skin->do_eject)
|
||||
return(1);
|
||||
|
||||
if(skin->n_drives<=skin->driveno || skin->driveno < 0)
|
||||
if((int) skin->n_drives <= skin->driveno || skin->driveno < 0)
|
||||
return(2);
|
||||
|
||||
/* ??? A61012 : retry loop might now be obsolete
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<HEAD>
|
||||
<META NAME="description" CONTENT="cdrskin, a limited cdrecord compatibility wrapper for libburn">
|
||||
<META NAME="keywords" CONTENT="cdrskin, libburn, libburnia, burn, CD, DVD, linux, recording, burning, CD-R, CD-RW, DVD-R, DVD-R DL, DVD-RW, DVD+RW, DVD+R, DVD+R DL, DVD-RAM, BD-RE, BD-R, cdrecord, compatible, scdbackup">
|
||||
<META NAME="keywords" CONTENT="cdrskin, libburn, libburnia, burn, CD, DVD, BD, linux, recording, burning, CD-R, CD-RW, DVD-R, DVD-R DL, DVD-RW, DVD+RW, DVD+R, DVD+R DL, DVD-RAM, BD-RE, BD-R, cdrecord, compatible, scdbackup">
|
||||
<META NAME="robots" CONTENT="follow">
|
||||
<TITLE>cdrskin homepage english</TITLE>
|
||||
</HEAD>
|
||||
@ -65,7 +65,7 @@ connected via SCSI, PATA (aka IDE, ATA), USB, or SATA.
|
||||
GPL software included:<BR>
|
||||
</H2>
|
||||
<DL>
|
||||
<DT>libburn-0.9.0</DT>
|
||||
<DT>libburn-1.1.0</DT>
|
||||
<DD>(founded by Derek Foreman and Ben Jansens,
|
||||
developed and maintained since August 2006 by
|
||||
Thomas Schmitt from team of libburnia-project.org)
|
||||
@ -200,7 +200,7 @@ Standalone ISO 9660 multi-session CD/DVD/BD tool
|
||||
<P>
|
||||
<DL>
|
||||
<DT>Download as source code (see README):</DT>
|
||||
<DD><A HREF="cdrskin-0.9.0.pl00.tar.gz">cdrskin-0.9.0.pl00.tar.gz</A>
|
||||
<DD><A HREF="cdrskin-1.1.0.tar.gz">cdrskin-1.1.0.tar.gz</A>
|
||||
(870 KB).
|
||||
</DD>
|
||||
<DD>
|
||||
@ -250,9 +250,8 @@ cdrskin_0.4.2.pl00-x86-suse9_0-static.tar.gz</A>, (310 KB), -static compiled,
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
Enhancements towards previous stable version cdrskin-0.8.8.pl00:
|
||||
Enhancements towards previous stable version cdrskin-1.0.6.pl00:
|
||||
<UL>
|
||||
<LI>
|
||||
<LI>none</LI>
|
||||
</LI>
|
||||
<!--
|
||||
@ -260,9 +259,12 @@ Enhancements towards previous stable version cdrskin-0.8.8.pl00:
|
||||
-->
|
||||
</UL>
|
||||
|
||||
Bug fixes towards cdrskin-0.8.8.pl00:
|
||||
Bug fixes towards cdrskin-1.0.6.pl00:
|
||||
<UL>
|
||||
<LI>SCSI reply data logging was disabled by mistake since release 0.8.6</LI>
|
||||
<LI>
|
||||
Option -format as_needed issued a wrong block size.
|
||||
A Pioneer BDR-205 drive refused on that command.
|
||||
</LI>
|
||||
<!--
|
||||
<LI>none</LI>
|
||||
-->
|
||||
@ -272,8 +274,8 @@ Bug fixes towards cdrskin-0.8.8.pl00:
|
||||
|
||||
<P>
|
||||
<DL>
|
||||
<DT><H3>Development snapshot, version 0.9.1 :</H3></DT>
|
||||
<DD>Enhancements towards current stable version 0.9.0.pl00:
|
||||
<DT><H3>Development snapshot, version 1.1.1 :</H3></DT>
|
||||
<DD>Enhancements towards current stable version 1.0.0:
|
||||
<UL>
|
||||
<LI>none yet</LI>
|
||||
<!--
|
||||
@ -283,7 +285,7 @@ Bug fixes towards cdrskin-0.8.8.pl00:
|
||||
</UL>
|
||||
</DD>
|
||||
|
||||
<DD>Bug fixes towards cdrskin-0.8.8.pl00:
|
||||
<DD>Bug fixes towards cdrskin-1.1.0:
|
||||
<UL>
|
||||
<LI>none yet</LI>
|
||||
<!--
|
||||
@ -293,10 +295,10 @@ Bug fixes towards cdrskin-0.8.8.pl00:
|
||||
</DD>
|
||||
|
||||
<DD> </DD>
|
||||
<DD><A HREF="README_cdrskin_devel">README 0.9.1</A>
|
||||
<DD><A HREF="cdrskin__help_devel">cdrskin_0.9.1 --help</A></DD>
|
||||
<DD><A HREF="cdrskin_help_devel">cdrskin_0.9.1 -help</A></DD>
|
||||
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.9.1)</A></DD>
|
||||
<DD><A HREF="README_cdrskin_devel">README 1.1.1</A>
|
||||
<DD><A HREF="cdrskin__help_devel">cdrskin-1.1.1 --help</A></DD>
|
||||
<DD><A HREF="cdrskin_help_devel">cdrskin-1.1.1 -help</A></DD>
|
||||
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 1.1.1)</A></DD>
|
||||
<DD> </DD>
|
||||
<DT>Maintainers of cdrskin unstable packages please use SVN of
|
||||
<A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT>
|
||||
@ -316,7 +318,7 @@ admins with full system souvereignty.</DT>
|
||||
<A HREF="README_cdrskin_devel">upcoming README</A> ):
|
||||
</DD>
|
||||
<DD>
|
||||
<A HREF="cdrskin-0.9.1.tar.gz">cdrskin-0.9.1.tar.gz</A>
|
||||
<A HREF="cdrskin-1.1.1.tar.gz">cdrskin-1.1.1.tar.gz</A>
|
||||
(870 KB).
|
||||
</DD>
|
||||
|
||||
|
@ -1 +1 @@
|
||||
#define Cdrskin_timestamP "2010.12.08.133001"
|
||||
#define Cdrskin_timestamP "2011.06.18.100001"
|
||||
|
@ -8980,7 +8980,7 @@ Made number transition to 0.9.0
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_9_1
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
08 Dec 2010 []
|
||||
08 Dec 2010 [3505]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
@ -8989,10 +8989,691 @@ Documented changes and release timestamp
|
||||
Regression fix: SCSI reply data logging was disabled in release 0.8.6
|
||||
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.9.1 -
|
||||
------------------------------------ cycle - cdrskin-0.9.1 -
|
||||
------------------------------------ cycle - cdrskin-0.9.1 -
|
||||
2010.12.08.131934 [3506]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 0.9.1
|
||||
|
||||
08 Dec 2010 [3507]
|
||||
- cdrskin/add_ts_changes_to_libburn_0_8_8
|
||||
- cdrskin/add_ts_changes_to_lisburn_0_8_9
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_9_0
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_9_1
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
08 Dec 2010 [3508]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
08 Dec 2010 [3509]
|
||||
svn move -m libburn release 0.9.0 is ready
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroNineZero
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroNineZero
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.9.1 - 2010.12.08.154833
|
||||
|
||||
2010.12.13.075956 [3522]
|
||||
configure.ac
|
||||
Prepending ./configure generated options to CFLAGS rather than appending them
|
||||
|
||||
23 Dec 2010 [3528]
|
||||
doc/comments
|
||||
Updated API introduction
|
||||
|
||||
2010.12.28.071904 [3537]
|
||||
libburn/write.c
|
||||
Allowed umask to create stdio-drive files with rw-permissions for all
|
||||
|
||||
2011.01.03.195125 [3542]
|
||||
libburn/write.c
|
||||
libburn/sector.c
|
||||
libburn/structure.h
|
||||
libburn/structure.c
|
||||
Allowed stdio tracks of known size to end in TAO mode on premature EOF
|
||||
|
||||
2011.01.09.135915 [3546]
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/cdrskin.1
|
||||
Refusing to burn if foreseeable size exceeds media capacity
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.9.1 - 2011.01.09.140240
|
||||
* Allowed umask to create stdio-drive files with rw-permissions for all
|
||||
* cdrskin now refuses to burn if the foreseeable size exceeds media capacity
|
||||
|
||||
|
||||
09 Jan 2011 [3547]
|
||||
cdrskin/cdrskin_eng.html
|
||||
ChangeLog
|
||||
Updated change log and web page
|
||||
|
||||
16 Jan 2011 [3548]
|
||||
svn copy -m "Branching for libburn release 1.0.0" \
|
||||
http://svn.libburnia-project.org/libburn/trunk \
|
||||
http://svn.libburnia-project.org/libburn/1.0.0"
|
||||
|
||||
2011.01.16.123001 [3549] [3550]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.0
|
||||
|
||||
16 Jan 2011 [3551]
|
||||
- cdrskin/add_ts_changes_to_libburn_0_9_0
|
||||
- cdrskin/add_ts_changes_to_libburn_0_9_1
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_0
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_1
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
16 Jan 2011 [3552]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
------------------------------ release - cdrskin-1.0.0.pl00 - 2011.01.16.123001
|
||||
* Allowed umask to create stdio-drive files with rw-permissions for all
|
||||
* cdrskin now refuses to burn if the foreseeable size exceeds media capacity
|
||||
|
||||
|
||||
2011.01.16.140456 [3553]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.1
|
||||
|
||||
16 Jan 2011 [3554]
|
||||
- cdrskin/add_ts_changes_to_libburn_0_9_0
|
||||
- cdrskin/add_ts_changes_to_libburn_0_9_1
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_0
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_1
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
16 Jan 2011 [3555]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
16 Jan 2011 [3556]
|
||||
svn move -m "libburn release 1.0.0 is ready" \
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.0 \
|
||||
http://svn.libburnia-project.org/libburn/tags/1.0.0
|
||||
|
||||
|
||||
------------------------------------ cycle - cdrskin-1.0.1 - 2011.01.16.152923
|
||||
|
||||
|
||||
2011.01.18.162859 [3570]
|
||||
libburn/file.c
|
||||
Using usleep() instead of nanosleep() which is not available on Solaris 9
|
||||
|
||||
2011.02.09.114311 [3586]
|
||||
libburn/write.c
|
||||
libburn/drive.c
|
||||
Forced role 3 on drives which stem from open file descriptors without O_RDWR
|
||||
|
||||
2011.02.14.085951 [3589]
|
||||
libburn/drive.c
|
||||
Reacted on compiler warnings about uninitialized variables
|
||||
|
||||
2011.02.18.165542 [3592]
|
||||
libburn/drive.c
|
||||
libburn/sector.c
|
||||
DEBUG message with burn_drive_cancel, FAILURE with premature end-of-input
|
||||
|
||||
23 Feb 2011 [3604]
|
||||
svn copy -m Branching for libburn release 1.0.2
|
||||
http://svn.libburnia-project.org/libburn/trunk
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.2
|
||||
|
||||
2011.02.23.130001 [3605]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.2
|
||||
|
||||
23 Feb 2011 [3606]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_0
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_1
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_2
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_3
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
23 Feb 2011 [3607]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
------------------------------ release - cdrskin-1.0.2.pl00 - 2011.02.23.130001
|
||||
* Removed compilation obstacles on Solaris 9.
|
||||
* Improved recognition of non-seekable stdio pseudo-drives.
|
||||
|
||||
|
||||
2011.02.23.193502 [3611]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.3
|
||||
|
||||
23 Feb 2011 [3612]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_0
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_1
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_2
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_3
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
23 Feb 2011 [3613]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
------------------------------------ cycle - cdrskin-1.0.3 - 2011.02.23.193502
|
||||
|
||||
|
||||
23 Feb 2011 [3614]
|
||||
svn move -m libburn release 1.0.2 is ready
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.2
|
||||
http://svn.libburnia-project.org/libburn/tags/1.0.2
|
||||
|
||||
2011.02.23.195650 [3615]
|
||||
libburn/libdax_msgs.h
|
||||
Registered new error code
|
||||
|
||||
2011.02.24.191718 [3619]
|
||||
libburn/async.c
|
||||
Corrected a flaw found by George Danchev with cpp
|
||||
|
||||
2011.03.01.144625 [3625]
|
||||
libburn/drive.c
|
||||
Bug fix: Read-only file descriptors were classified as write-only pseudo drives
|
||||
|
||||
svn copy -m Branching for libburn release 1.0.4
|
||||
http://svn.libburnia-project.org/libburn/trunk
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.4
|
||||
|
||||
2011.03.10.080001 [3651]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.4
|
||||
|
||||
10 Mar 2011 [3652]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_2
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_3
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_4
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_5
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
10 Mar 2011 [3653]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
------------------------------ release - cdrskin-1.0.4.pl00 - 2011.03.10.080001
|
||||
* Bug fix: Read-only file descriptors were classified as write-only pseudo drives
|
||||
|
||||
|
||||
2011.03.10.132603 [3657]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.5
|
||||
|
||||
10 Mar 2011 [3659]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_2
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_3
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_4
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_5
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
10 Mar 2011 [3660]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
10 Mar 2011 [3658]
|
||||
svn move -m libburn release 1.0.4 is ready
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.4
|
||||
http://svn.libburnia-project.org/libburn/tags/1.0.4
|
||||
|
||||
------------------------------------ cycle - cdrskin-1.0.5 - 2011.03.10.132603
|
||||
|
||||
|
||||
12 Mar 2011 [3664]
|
||||
COPYRIGHT
|
||||
Updated copyright year
|
||||
|
||||
2011.03.12.093520 [3665]
|
||||
libburn/write.c
|
||||
libburn/mmc.c
|
||||
Burning DVD-R DAO with 2 kB size granularity rather than 32 kB
|
||||
|
||||
2011.03.13.130746 [3666]
|
||||
libburn/libburn.h
|
||||
libburn/init.c
|
||||
libburn/drive.c
|
||||
libburn/async.c
|
||||
libburn/write.c
|
||||
libburn/libdax_msgs.h
|
||||
libburn/libburn.ver
|
||||
New API call burn_allow_drive_role_4()
|
||||
|
||||
2011.03.13.130850 [3667]
|
||||
cdrskin/cdrskin.c
|
||||
Using burn_allow_drive_role_4() in cdrskin
|
||||
|
||||
2011.03.13.192627 [3671]
|
||||
libburn/read.c
|
||||
libburn/libdax_msgs.h
|
||||
Changed severity of "Read attempt on write-only drive" from FATAL to FAILURE
|
||||
|
||||
2011.03.18.093128 [3672]
|
||||
cdrskin/cdrskin.c
|
||||
Prepared cdrskin for drive role 5
|
||||
|
||||
2011.03.18.093410 [3673]
|
||||
libburn/transport.h
|
||||
libburn/drive.c
|
||||
libburn/async.c
|
||||
libburn/write.c
|
||||
libburn/read.c
|
||||
libburn/libdax_msgs.h
|
||||
Provisory introduction of drive role 5, random access write-only
|
||||
|
||||
2011.03.18.153326 [3674]
|
||||
libburn/async.c
|
||||
libburn/mmc.c
|
||||
Enabled BD formatting by index on Pioneer BDR-205 which offers no Cert or QCert
|
||||
|
||||
2011.03.19.222152 [3675]
|
||||
libburn/sector.c
|
||||
Silenced an error message with input that is not aligned to 2 kB
|
||||
|
||||
2011.03.21.090313 [3676]
|
||||
libburn/drive.c
|
||||
Corrected nwa computation for drive role 5
|
||||
|
||||
2011.03.21.090430 [3677]
|
||||
libburn/write.c
|
||||
Adjustments for drive role 5, random access write-only
|
||||
|
||||
2011.03.21.092220 [3678]
|
||||
libburn/async.c
|
||||
Enabled blanking of drive with role 5
|
||||
|
||||
2011.03.22.085956 [3685]
|
||||
libburn/libburn.h
|
||||
libburn/init.c
|
||||
libburn/drive.c
|
||||
Avoiding appendable role 5 if not explicitely enabled
|
||||
|
||||
2011.03.24.182148 [3687]
|
||||
libburn/libburn.h
|
||||
libburn/read.c
|
||||
libburn/libdax_msgs.h
|
||||
Better handling of read attempt on pseudo-drive without read-permission
|
||||
|
||||
8 Apr 2011 [3712]
|
||||
svn copy -m Branching for libburn release 1.0.6
|
||||
http://svn.libburnia-project.org/libburn/trunk
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.6
|
||||
|
||||
2011.04.08.180001 [3713]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.6
|
||||
|
||||
08 Apr 2011 [3714]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_4
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_5
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_6
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_7
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
08 Apr 2011 [3715]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
------------------------------ release - cdrskin-1.0.6.pl00 - 2011.04.08.180001
|
||||
* Burning DVD-R DAO with 2 kB size granularity rather than 32 kB
|
||||
* New API call burn_allow_drive_role_4()
|
||||
|
||||
|
||||
2011.04.09.090001 [3719]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.7
|
||||
|
||||
09 Apr 2011 [3720]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_4
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_5
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_6
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_0_7
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
09 Apr 2011 [3721]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
09 Apr 2011 [3722]
|
||||
svn move -m libburn release 1.0.6 is ready
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.6
|
||||
http://svn.libburnia-project.org/libburn/tags/1.0.6
|
||||
|
||||
------------------------------------ cycle - cdrskin-1.0.7 - 2011.04.09.090001
|
||||
|
||||
|
||||
15 Apr 2011 [3735]
|
||||
doc/doxygen.conf.in
|
||||
Disabled HAVE_DOT in doxygen.conf
|
||||
|
||||
2011.05.01.144546 [3743]
|
||||
libburn/init.c
|
||||
Closed tiny memory leak found by valgrind
|
||||
|
||||
2011.05.12.120503 [3791]
|
||||
libburn/drive.h
|
||||
Including header pthread.h on request of Mats Andersson for OpenBSD
|
||||
|
||||
2011.05.12.134723 [3792]
|
||||
libburn/init.c
|
||||
libburn/drive.c
|
||||
libburn/structure.c
|
||||
libburn/mmc.c
|
||||
libburn/sg-linux.c
|
||||
Reacted on -Wsign-compare warnings of gcc
|
||||
|
||||
2011.05.12.135008 [3793]
|
||||
cdrskin/cdrskin.c
|
||||
Reacted on -Wsign-compare warnings of gcc
|
||||
|
||||
2011.05.12.135116 [3794]
|
||||
test/libburner.c
|
||||
Reacted on -Wsign-compare warnings of gcc
|
||||
|
||||
2011.05.12.135217 [3795]
|
||||
test/telltoc.
|
||||
Reacted on -Wsign-compare warnings of gcc
|
||||
|
||||
12 May 2011 [3796]
|
||||
test/poll.c
|
||||
Reacted on -Wsign-compare warnings of gcc
|
||||
|
||||
14 May 2011 [3803]
|
||||
Makefile.am
|
||||
doc/cookbook.txt
|
||||
doc/mediainfo.txt
|
||||
Added cookbook.txt and mediainfo.txt to tarball on request of George Danchev
|
||||
|
||||
2011.05.15.104727 [3804]
|
||||
libburn/init.h
|
||||
Macros BURN_ALLOC_MEM, BURN_FREE_MEM for replaceing local variables
|
||||
|
||||
2011.05.15.104926 [3805]
|
||||
libburn/async.c
|
||||
Replaced some large local variables by other means in libburn/async.c
|
||||
|
||||
2011.05.15.181724 [3806]
|
||||
libburn/init.h
|
||||
Polished macro BURN_ALLOC_MEM
|
||||
|
||||
2011.05.15.191420 [3807]
|
||||
libburn/drive.c
|
||||
Replaced some large local variables by other means in libburn/drive.c
|
||||
|
||||
2011.05.15.203140 [3808]
|
||||
libburn/init.h
|
||||
libburn/async.c
|
||||
Added forgotten return value to BURN_ALLOC_MEM
|
||||
|
||||
22 May 2011 [3830]
|
||||
doc/mediainfo.txt
|
||||
Added a DVD+RW product id to the list
|
||||
|
||||
22 May 2011 [3831]
|
||||
configure.ac
|
||||
Added options -Wextra -Wno-unused-parameter for gcc
|
||||
|
||||
2011.05.23.154011 [3834]
|
||||
libburn/mmc.c
|
||||
Replaced some large local variables by other means in libburn/mmc.c
|
||||
|
||||
2011.05.23.155217 [3835]
|
||||
libburn/read.c
|
||||
Replaced some large local variables by other means in libburn/read.c
|
||||
|
||||
2011.05.23.163506 [3836]
|
||||
libburn/sg-dummy.c
|
||||
Replaced some large local variables by other means in libburn/sg-dummy.c
|
||||
|
||||
2011.05.23.174016 [3837]
|
||||
libburn/sg-freebsd.c
|
||||
Replaced some large local variables by other means in libburn/sg-freebsd.c
|
||||
|
||||
2011.05.23.182627 [3838]
|
||||
libburn/sg-freebsd-port.c
|
||||
Replaced some large local variables by other means in libburn/sg-freebsd-port.c
|
||||
|
||||
2011.05.26.145626 [3839]
|
||||
libburn/transport.h
|
||||
libburn/libdax_msgs.h
|
||||
libburn/mmc.c
|
||||
Improved reaction on Damage Bit and missing NWA_V of READ TRACK INFORMATION
|
||||
|
||||
2011.05.26.150020 [3840]
|
||||
libburn/libburn.h
|
||||
libburn/drive.c
|
||||
libburn/libburn.ver
|
||||
New API call burn_disc_next_track_is_damaged()
|
||||
|
||||
2011.05.31.103124 [3846]
|
||||
libburn/write.h
|
||||
libburn/write.c
|
||||
libburn/libdax_msgs.h
|
||||
libburn/libburn.ver
|
||||
New API call burn_disc_close_damaged()
|
||||
|
||||
2011.06.02.083808 [3848]
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-freebsd-port.c
|
||||
Gave up use of bzero() in FreeBSD system adapters
|
||||
|
||||
2011.06.02.132554 [3849]
|
||||
libburn/sg-libcdio.c
|
||||
Replaced some large local variables by other means in libburn/sg-libcdio.c
|
||||
|
||||
2011.06.05.170431 [3850]
|
||||
libburn/sg-linux.c
|
||||
Replaced some large local variables by other means in libburn/sg-linux.c
|
||||
|
||||
2011.06.06.104404 [3851]
|
||||
libburn/sg-solaris.c
|
||||
Replaced some large local variables by other means in libburn/sg-solaris.c
|
||||
|
||||
2011.06.06.105052 [3852]
|
||||
libburn/sg-solaris.c
|
||||
Reacted on warnings of gcc about mixed sign comparison
|
||||
|
||||
2011.06.06.173021 [3853]
|
||||
libburn/spc.c
|
||||
Replaced some large local variables by other means in libburn/spc.c
|
||||
|
||||
2011.06.06.173611 [3854]
|
||||
libburn/init.h
|
||||
libburn/init.c
|
||||
Leaner implementation of macro BURN_ALLOC_MEM
|
||||
|
||||
2011.06.07.084343 [3855]
|
||||
libburn/write.c
|
||||
Closed a small memory leak with CD SAO found by valgrind
|
||||
|
||||
2011.06.07.143930 [3856]
|
||||
libburn/transport.h
|
||||
libburn/spc.c
|
||||
libburn/sbc.c
|
||||
libburn/mmc.c
|
||||
Consolidated several local struct command to a new member of struct burn_drive
|
||||
|
||||
2011.06.08.081338 [3858]
|
||||
libburn/structure.c
|
||||
Replaced some large local variables by other means in libburn/structure.c
|
||||
|
||||
2011.06.08.082201 [3859]
|
||||
libburn/toc.c
|
||||
Replaced some large local variables by other means in libburn/toc.c
|
||||
|
||||
2011.06.08.181204 [3860]
|
||||
libburn/mmc.c
|
||||
Bug fix: burn_disc_format() on DVD-RW issued wrong block size with type 00h
|
||||
|
||||
8 Jun 2011 [3861]
|
||||
configure.ac
|
||||
Makefile.am
|
||||
Introduced AC_CONFIG_MACRO_DIR() and ACLOCAL_AMFLAGS on advise of George Danchev
|
||||
|
||||
2011.06.08.200329 [3863]
|
||||
libburn/write.c
|
||||
Replaced some large local variables by other means in libburn/write.c
|
||||
|
||||
9 Jun 2011 [3864]
|
||||
bootstrap
|
||||
Added option -I . to aclocal in bootstrap script on advise of George Danchev
|
||||
|
||||
2011.06.14.152832 [3866]
|
||||
libburn/spc.c
|
||||
libburn/mmc.c
|
||||
Reporting SCSI error if command RESERVE TRACK fails
|
||||
|
||||
|
||||
Release 1.0.8 was skipped to get back in sync with libisofs and libisoburn.
|
||||
|
||||
|
||||
18 Jun 2011 [3868]
|
||||
svn copy -m Branching for libburn release 1.1.0
|
||||
http://svn.libburnia-project.org/libburn/trunk
|
||||
http://svn.libburnia-project.org/libburn/branches/1.1.1
|
||||
|
||||
2011.06.18.100001 [3869]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.1.0
|
||||
|
||||
18 Jun 2011 [3870]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_6
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_7
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_1_0
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_1_1
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
18 Jun 2011 []
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
----------------------------------- release - cdrskin-1.1.0 - 2011.06.18.100001
|
||||
* New API call burn_disc_next_track_is_damaged()
|
||||
* New API call burn_disc_close_damaged()
|
||||
* Bug fix: burn_disc_format() on DVD-RW issued wrong block size with type 00h
|
||||
|
||||
|
||||
[]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 1.0.7
|
||||
|
||||
[]
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_6
|
||||
- cdrskin/add_ts_changes_to_libburn_1_0_7
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_1_0
|
||||
+ cdrskin/add_ts_changes_to_libburn_1_1_1
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
[]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
09 Apr 2011 [3722]
|
||||
svn move -m libburn release 1.0.6 is ready
|
||||
http://svn.libburnia-project.org/libburn/branches/1.0.6
|
||||
http://svn.libburnia-project.org/libburn/tags/1.0.6
|
||||
|
||||
------------------------------------ cycle - cdrskin-1.1.1 -
|
||||
|
||||
------------------------------------ cycle - cdrskin-1.1.1 -
|
||||
------------------------------------ cycle - cdrskin-1.1.1 -
|
||||
|
||||
|
||||
|
||||
@ -9006,17 +9687,14 @@ Important: When adding a public API function then add its name to file
|
||||
===============================================================================
|
||||
|
||||
|
||||
cdrskin -tao starts with known size that is larger than media capacity
|
||||
Track 01: 4486 of 4488 MB written (fifo 100%) [buf<75> 92%]<5D><> 8.1x.
|
||||
Track 01: 4487 of 4488 MB written (fifo 100%) [buf<75> 92%]<5D><> 8.1x.
|
||||
cdrskin: FATAL : Exceeding range of permissible write addresses
|
||||
(2297888 >= 2297888)
|
||||
Track 01: 4488 of 4488 MB written (fifo 100%) [buf<75> 92%]<5D><> 7.4x.
|
||||
Throw out old burn_print() calls
|
||||
|
||||
|
||||
Expose BD type from bytes 8+4 to 10+4 out of READ BD STRUCTURE form 0.
|
||||
|
||||
|
||||
Better motivation of burn_set_signal_handling() in libburn.h.
|
||||
|
||||
|
||||
-------------------------------- Solaris -----------------------------------
|
||||
|
||||
Locking of device files.
|
||||
@ -9038,16 +9716,11 @@ pntadm -A 10.0.0.24 -f MANUAL -i 010008544255E7 -m 10.0.0.0 -y 10.0.0.0
|
||||
|
||||
--------------------------------- bugs -------------------------------------
|
||||
|
||||
- recognise sense data format 0x72 rather than 0x70
|
||||
Key=[1], ASC=[2], ASCQ=[3]
|
||||
(check libcdio too)
|
||||
|
||||
|
||||
- handle HD DVD profiles 0x50 "HD DVD-ROM", 0x51 "HD DVD-R", 0x52 "HD DVD-RAM"
|
||||
as readable.
|
||||
|
||||
- Do something about drive->buffer asynchronous race conditions
|
||||
and dangerous use of local heap memory.
|
||||
and dangerous use of temporary dynamic memory.
|
||||
(The various asynchronous operations use the same buffer
|
||||
pointer in struct burn_drive and let it point to
|
||||
their private memory.
|
||||
|
@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# compile_cdrskin.sh
|
||||
# Copyright 2005 - 2010 Thomas Schmitt, scdbackup@gmx.net, GPL
|
||||
# Copyright 2005 - 2011 Thomas Schmitt, scdbackup@gmx.net, GPL
|
||||
# to be executed within ./libburn-* resp ./cdrskin-*
|
||||
|
||||
debug_opts="-O2"
|
||||
def_opts=
|
||||
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
|
||||
fifo_opts=""
|
||||
libvers="-DCdrskin_libburn_0_9_0"
|
||||
libvers="-DCdrskin_libburn_1_1_0"
|
||||
|
||||
# To be used if Makefile.am uses libburn_libburn_la_CFLAGS
|
||||
# burn="libburn/libburn_libburn_la-"
|
||||
@ -47,15 +47,15 @@ do
|
||||
libdax_audioxtr_o=
|
||||
libdax_msgs_o="$burn"message.o
|
||||
cleanup_src_or_obj="-DCleanup_has_no_libburn_os_H cdrskin/cleanup.c"
|
||||
elif test "$i" = "-libburn_0_9_0"
|
||||
elif test "$i" = "-libburn_1_1_0"
|
||||
then
|
||||
libvers="-DCdrskin_libburn_0_9_0"
|
||||
libvers="-DCdrskin_libburn_1_1_0"
|
||||
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
libdax_msgs_o="$burn"libdax_msgs.o
|
||||
cleanup_src_or_obj="$burn"cleanup.o
|
||||
elif test "$i" = "-libburn_svn"
|
||||
then
|
||||
libvers="-DCdrskin_libburn_0_9_1"
|
||||
libvers="-DCdrskin_libburn_1_1_1"
|
||||
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
libdax_msgs_o="$burn"libdax_msgs.o
|
||||
cleanup_src_or_obj="$burn"cleanup.o
|
||||
@ -109,7 +109,7 @@ do
|
||||
echo "Options:"
|
||||
echo " -compile_cdrfifo compile program cdrskin/cdrfifo."
|
||||
echo " -compile_dewav compile program test/dewav without libburn."
|
||||
echo " -libburn_0_9_0 set macro to match libburn-0.9.0"
|
||||
echo " -libburn_1_1_0 set macro to match libburn-1.1.0"
|
||||
echo " -libburn_svn set macro to match current libburn-SVN."
|
||||
echo " -dvd_obs_64k 64 KB default size for DVD/BD writing."
|
||||
echo " -use_libcdio link with -lcdio because libburn uses it."
|
||||
|
40
configure.ac
40
configure.ac
@ -1,4 +1,4 @@
|
||||
AC_INIT([libburn], [0.9.0], [http://libburnia-project.org])
|
||||
AC_INIT([libburn], [1.1.0], [http://libburnia-project.org])
|
||||
AC_PREREQ([2.50])
|
||||
dnl AC_CONFIG_HEADER([config.h])
|
||||
|
||||
@ -8,8 +8,9 @@ AC_CANONICAL_TARGET
|
||||
LIBBURNIA_SET_FLAGS
|
||||
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
AC_CONFIG_MACRO_DIR([./])
|
||||
|
||||
dnl Notes by ts A71207 - B00630 :
|
||||
dnl Notes by ts A71207 - B10409 :
|
||||
dnl
|
||||
dnl Regrettably the meaning of the various version types was misunderstood
|
||||
dnl before version 0.4.1.
|
||||
@ -86,6 +87,11 @@ dnl 0.8.4 = libburn.so.4.49.0
|
||||
dnl 0.8.6 = libburn.so.4.51.0
|
||||
dnl 0.8.8 = libburn.so.4.53.0
|
||||
dnl 0.9.0 = libburn.so.4.55.0
|
||||
dnl 1.0.0 = libburn.so.4.57.0
|
||||
dnl 1.0.2 = libburn.so.4.59.0
|
||||
dnl 1.0.4 = libburn.so.4.61.0
|
||||
dnl 1.0.6 = libburn.so.4.63.0
|
||||
dnl 1.1.0 = libburn.so.4.65.0
|
||||
dnl
|
||||
dnl So LT_CURRENT, LT_REVISION and LT_AGE get set directly here.
|
||||
dnl SONAME of the emerging library is LT_CURRENT - LT_AGE.
|
||||
@ -109,8 +115,8 @@ dnl
|
||||
dnl If BURN_*_VERSION changes, be sure to change AC_INIT above to match.
|
||||
dnl
|
||||
dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_*
|
||||
BURN_MAJOR_VERSION=0
|
||||
BURN_MINOR_VERSION=9
|
||||
BURN_MAJOR_VERSION=1
|
||||
BURN_MINOR_VERSION=1
|
||||
BURN_MICRO_VERSION=0
|
||||
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
|
||||
@ -122,14 +128,14 @@ AC_SUBST(BURN_VERSION)
|
||||
dnl Libtool versioning
|
||||
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
dnl
|
||||
dnl This is the release version libburn-0.9.0
|
||||
dnl This is the release version libburn-1.1.0
|
||||
dnl ### This is the development version after above release version
|
||||
dnl LT_CURRENT++, LT_AGE++ has not yet happened.
|
||||
dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile.
|
||||
dnl
|
||||
dnl SONAME = 59 - 55 = 4 . Linux library name = libburn.so.4.55.0
|
||||
LT_CURRENT=59
|
||||
LT_AGE=55
|
||||
dnl SONAME = 69 - 65 = 4 . Linux library name = libburn.so.4.65.0
|
||||
LT_CURRENT=69
|
||||
LT_AGE=65
|
||||
LT_REVISION=0
|
||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||
|
||||
@ -187,7 +193,7 @@ AC_CHECK_HEADER(sys/statvfs.h, X=, STATVFS_DEF=)
|
||||
AC_CHECK_FUNC([statvfs], X=, STATVFS_DEF=)
|
||||
dnl If this would be done more specifically in Makefile.am
|
||||
dnl via libburn_libburn_la_CFLAGS then undesired .o file names would emerge
|
||||
CFLAGS="$CFLAGS $STATVFS_DEF"
|
||||
CFLAGS="$STATVFS_DEF $CFLAGS"
|
||||
|
||||
dnl ts A91122
|
||||
AC_ARG_ENABLE(track-src-odirect,
|
||||
@ -202,7 +208,7 @@ else
|
||||
fi
|
||||
dnl Avoid the need for libburn_libburn_la_CFLAGS in Makefile.am (ugly .o names)
|
||||
dnl ### AC_SUBST(LIBBURN_O_DIRECT_DEF)
|
||||
CFLAGS="$CFLAGS $LIBBURN_O_DIRECT_DEF"
|
||||
CFLAGS="$LIBBURN_O_DIRECT_DEF $CFLAGS"
|
||||
|
||||
dnl ts A91116
|
||||
AC_ARG_ENABLE(dvd-obs-64k,
|
||||
@ -215,7 +221,7 @@ else
|
||||
LIBBURN_DVD_OBS_64K=
|
||||
echo "disabled write size default 64 KB on DVD and BD"
|
||||
fi
|
||||
CFLAGS="$CFLAGS $LIBBURN_DVD_OBS_64K"
|
||||
CFLAGS="$LIBBURN_DVD_OBS_64K $CFLAGS"
|
||||
|
||||
dnl ts A91218
|
||||
AC_ARG_ENABLE(libcdio,
|
||||
@ -238,7 +244,7 @@ then
|
||||
fi
|
||||
else
|
||||
echo "enabled EXPERIMENTAL use of libcdio as system adapter"
|
||||
CFLAGS="$CFLAGS $LIBCDIO_DEF"
|
||||
CFLAGS="$LIBCDIO_DEF $CFLAGS"
|
||||
|
||||
LIBCDIO_REQUIRED=0.83
|
||||
PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)
|
||||
@ -286,15 +292,15 @@ AC_ARG_ENABLE(debug,
|
||||
, enable_debug=yes)
|
||||
if test x$enable_debug != xyes; then
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="$CFLAGS -O3"
|
||||
CFLAGS="$CFLAGS -fexpensive-optimizations"
|
||||
CFLAGS="-O3 $CFLAGS"
|
||||
CFLAGS="-fexpensive-optimizations $CFLAGS"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -DNDEBUG"
|
||||
CFLAGS="-DNDEBUG $CFLAGS"
|
||||
else
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="$CFLAGS -g -pedantic -Wall"
|
||||
CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter $CFLAGS"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -DDEBUG"
|
||||
CFLAGS="-DDEBUG $CFLAGS"
|
||||
fi
|
||||
|
||||
dnl Determine target directory for libburn-*.pc
|
||||
|
13
doc/comments
13
doc/comments
@ -8,14 +8,13 @@
|
||||
Libburnia is an open-source project for reading, mastering and writing
|
||||
optical discs. This page is about its capability to handle optical media.
|
||||
For now this means CD-R, CD-RW, DVD-RAM, DVD+RW, DVD+R, DVD+R/DL, DVD-RW,
|
||||
DVD-R, BD-R, BD-RE.
|
||||
DVD-R, DVD-R/DL, BD-R, BD-RE.
|
||||
|
||||
Not supported yet are DVD-R/DL. Testers wanted.
|
||||
|
||||
Our scope is currently Linux 2.4 and 2.6, or FreeBSD . For ports to other
|
||||
systems we would need : login on a development machine resp. a live OS on CD
|
||||
or DVD, advise from a system person about the equivalent of Linux sg or FreeBSD
|
||||
CAM, volunteers for testing of realistic use cases.
|
||||
Our scope is currently Linux 2.4 and 2.6, or FreeBSD, or Solaris . For ports
|
||||
to other systems we would need : login on a development machine resp.
|
||||
an OS ithat is installable on an AMD 64-bit PC, advise from a system person
|
||||
about the equivalent of Linux sg or FreeBSD CAM, volunteers for testing of
|
||||
realistic use cases.
|
||||
|
||||
libburn is the library by which preformatted data get onto optical media.
|
||||
Its code is independent of cdrecord. Its DVD capabilities are learned from
|
||||
|
@ -1,3 +1,9 @@
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Note: This is about how libburn operates optical drives. Not about how to
|
||||
operate libburn. The libburn API is described in libburn/libburn.h
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
libburnia-project.org Optical Media Rotisserie Recipes as of January 2010
|
||||
|
||||
Content:
|
||||
|
@ -1145,7 +1145,8 @@ HIDE_UNDOC_RELATIONS = YES
|
||||
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
|
||||
# have no effect if this option is set to NO (the default)
|
||||
|
||||
HAVE_DOT = YES
|
||||
# ts B10415: dot causes sigsegv on Debian buildd
|
||||
HAVE_DOT = NO
|
||||
|
||||
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
|
@ -1,4 +1,10 @@
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Note: This is about how libburn operates optical drives. Not about how to
|
||||
operate libburn. The libburn API is described in libburn/libburn.h
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Overview of class specific or individual media information
|
||||
especially manufacturer and exact product type
|
||||
|
||||
@ -172,6 +178,9 @@ BD-R and BD-RE:
|
||||
Table 288 says that Media Type Code (byte 1 of CDB) for BD media is 1.
|
||||
Table 446 says that Disc Information is preceeded by 4 bytes of header.
|
||||
Table 448 says that bytes 0 to 1 are Disc Information Identifier "DI".
|
||||
that bytes 8 to 10 are Disc Type Identifier
|
||||
BDO for BD-ROM, BDW for BD-RE,
|
||||
BDR for BD-R
|
||||
that bytes 100 to 105 are Disc Manufactuer ID
|
||||
that bytes 106 to 108 are Media Type ID
|
||||
that byte 111 is Product Revision Number
|
||||
@ -933,6 +942,7 @@ CMCMAG CN2 CMC Magnetics Corporation 1-2X HTL 25GB(12cm) [Blu]
|
||||
DAXON 016 DAXON 8X [Hij]
|
||||
DAXON AZ3 DAXON 16X [Hij]
|
||||
DAXON CY3 DAXON 12X [Hij]
|
||||
DAXON D42/52 (user reported DVD+RW)
|
||||
Daxon R2X Daxon Technology Inc. 1-2X HTL 25GB(12cm) [Blu]
|
||||
Daxon R4X Daxon Technology Inc. 1-4X HTL 25GB(12cm) [Blu]
|
||||
|
||||
@ -1172,6 +1182,7 @@ TTH02 TDK 12X [Hij]
|
||||
TYG01 TAIYO YUDEN 4X [Hij]
|
||||
TYG02 TAIYO YUDEN 12X [Hij]
|
||||
TYG03 TAIYO YUDEN 16X [Hij]
|
||||
TYG11 TAIYO YUDEN DVD-R DL 8x
|
||||
TYG-BD Y01 TAIYO YUDEN Co., Ltd. 1-2X LTH [Blu]
|
||||
TYG-BD Y03 TAIYO YUDEN Co., Ltd. 1-4X LTH [Blu]
|
||||
|
||||
|
@ -355,7 +355,7 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
|
||||
/* a ssert(!find_worker(drive)); */
|
||||
|
||||
if((drive == NULL)) {
|
||||
libdax_msgs_submit(libdax_messenger, drive->global_index,
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
0x00020104,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"NULL pointer caught in burn_disc_erase", 0, 0);
|
||||
@ -383,7 +383,9 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
|
||||
/* ts A70909 : the willingness to burn any BURN_DISC_FULL media is
|
||||
inappropriate. One would rather need a -force option
|
||||
Note: keep this in sync with mmc_read_disc_info() */
|
||||
if ((drive->current_profile != 0x0a &&
|
||||
/* ts B10321 : Allowed role 5 to be blanked */
|
||||
if ((drive->drive_role == 1 &&
|
||||
drive->current_profile != 0x0a &&
|
||||
drive->current_profile != 0x13 &&
|
||||
drive->current_profile != 0x14 &&
|
||||
drive->status != BURN_DISC_FULL)
|
||||
@ -392,7 +394,7 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
|
||||
drive->status != BURN_DISC_APPENDABLE &&
|
||||
drive->status != BURN_DISC_BLANK)
|
||||
||
|
||||
(drive->drive_role != 1)
|
||||
(drive->drive_role != 1 && drive->drive_role != 5)
|
||||
) {
|
||||
libdax_msgs_submit(libdax_messenger, drive->global_index,
|
||||
0x00020130,
|
||||
@ -443,7 +445,7 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
|
||||
{
|
||||
struct format_opts o;
|
||||
int ok = 0, ret;
|
||||
char msg[160];
|
||||
char msg[40];
|
||||
|
||||
reset_progress(drive, 1, 1, 1, 0x10000, 0);
|
||||
|
||||
@ -517,42 +519,6 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
|
||||
return;
|
||||
|
||||
}
|
||||
if ((flag & 6) != 6 || (flag & 128)) {
|
||||
if ((flag & 64) && !(drive->current_feat23h_byte4 & 2)) {
|
||||
if (drive->current_feat23h_byte4 & 1) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
drive->global_index, 0x00020165,
|
||||
LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive does not support fast formatting",
|
||||
0, 0);
|
||||
flag &= ~64;
|
||||
} else {
|
||||
no_non_default_bd_re:;
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
drive->global_index, 0x00020167,
|
||||
LIBDAX_MSGS_SEV_SORRY,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive does not support non-default formatting",
|
||||
0, 0);
|
||||
drive->cancel = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((!(flag & 64)) && !(drive->current_feat23h_byte4 & 1)){
|
||||
if (drive->current_feat23h_byte4 & 2) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
drive->global_index, 0x00020166,
|
||||
LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive does not support full formatting",
|
||||
0, 0);
|
||||
flag |= 64;
|
||||
} else
|
||||
goto no_non_default_bd_re;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
@ -619,8 +585,9 @@ static void *write_disc_worker_func(struct w_list *w)
|
||||
|
||||
void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
{
|
||||
int ret;
|
||||
struct write_opts o;
|
||||
char reasons[BURN_REASONS_LEN+80];
|
||||
char *reasons= NULL;
|
||||
struct burn_drive *d;
|
||||
|
||||
d = opts->drive;
|
||||
@ -659,6 +626,14 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
"Drive is a virtual placeholder (null-drive)", 0, 0);
|
||||
return;
|
||||
}
|
||||
if (d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* ts A61007 : obsolete Assert in spc_select_write_params() */
|
||||
if (d->drive_role == 1 && d->mdata->valid <= 0) {
|
||||
@ -672,6 +647,8 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
/* ts A70219 : intended to replace all further tests here and many
|
||||
tests in burn_*_write_sync()
|
||||
*/
|
||||
|
||||
BURN_ALLOC_MEM(reasons, char, BURN_REASONS_LEN + 80);
|
||||
strcpy(reasons, "Write job parameters are unsuitable:\n");
|
||||
if (burn_precheck_write(opts, disc, reasons + strlen(reasons), 1)
|
||||
<= 0) {
|
||||
@ -679,8 +656,9 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
d->global_index, 0x00020139,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
reasons, 0, 0);
|
||||
return;
|
||||
goto ex;
|
||||
}
|
||||
BURN_FREE_MEM(reasons); reasons= NULL;
|
||||
|
||||
/* ts A90106 : early catching of unformatted BD-RE */
|
||||
if (d->current_profile == 0x43)
|
||||
@ -704,6 +682,9 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
|
||||
add_worker(Burnworker_type_writE, d,
|
||||
(WorkerFunc) write_disc_worker_func, &o);
|
||||
|
||||
ex:;
|
||||
BURN_FREE_MEM(reasons);
|
||||
}
|
||||
|
||||
|
||||
|
491
libburn/drive.c
491
libburn/drive.c
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include <ctype.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include "libburn.h"
|
||||
#include "init.h"
|
||||
#include "drive.h"
|
||||
@ -59,6 +60,10 @@ static int drivetop = -1;
|
||||
/* ts A80410 : in init.c */
|
||||
extern int burn_support_untested_profiles;
|
||||
|
||||
/* ts B10312 : in init.c */
|
||||
extern int burn_drive_role_4_allowed;
|
||||
|
||||
|
||||
/* ts A61021 : the unspecific part of sg.c:enumerate_common()
|
||||
*/
|
||||
int burn_setup_drive(struct burn_drive *d, char *fname)
|
||||
@ -73,6 +78,7 @@ int burn_setup_drive(struct burn_drive *d, char *fname)
|
||||
d->status = BURN_DISC_UNREADY;
|
||||
d->do_stream_recording = 0;
|
||||
d->stream_recording_start= 0;
|
||||
d->role_5_nwa = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -212,7 +218,10 @@ unsigned int burn_drive_count(void)
|
||||
int burn_drive_is_listed(char *path, struct burn_drive **found, int flag)
|
||||
{
|
||||
int i, ret;
|
||||
char drive_adr[BURN_DRIVE_ADR_LEN], off_adr[BURN_DRIVE_ADR_LEN];
|
||||
char *drive_adr = NULL, *off_adr = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(drive_adr, char, BURN_DRIVE_ADR_LEN);
|
||||
BURN_ALLOC_MEM(off_adr, char, BURN_DRIVE_ADR_LEN);
|
||||
|
||||
ret = burn_drive_convert_fs_adr(path, off_adr);
|
||||
if (ret <= 0)
|
||||
@ -226,10 +235,14 @@ int burn_drive_is_listed(char *path, struct burn_drive **found, int flag)
|
||||
if(strcmp(off_adr, drive_adr) == 0) {
|
||||
if (found != NULL)
|
||||
*found= &(drive_array[i]);
|
||||
return 1;
|
||||
{ret= 1; goto ex;}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
ret= 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(drive_adr);
|
||||
BURN_FREE_MEM(off_adr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -307,8 +320,9 @@ int burn_drive_inquire_media(struct burn_drive *d)
|
||||
int burn_drive_grab(struct burn_drive *d, int le)
|
||||
{
|
||||
int errcode;
|
||||
/* ts A61125 - A61202 */
|
||||
int ret, sose;
|
||||
/* ts A61125 - B10314 */
|
||||
int ret, sose, stat_ret = -1;
|
||||
struct stat stbuf;
|
||||
|
||||
if (!d->released) {
|
||||
burn_print(1, "can't grab - already grabbed\n");
|
||||
@ -316,9 +330,24 @@ int burn_drive_grab(struct burn_drive *d, int le)
|
||||
}
|
||||
if(d->drive_role != 1) {
|
||||
d->released = 0;
|
||||
d->current_profile = 0xffff;
|
||||
if (d->devname[0])
|
||||
stat_ret = stat(d->devname, &stbuf);
|
||||
if(d->drive_role == 2 || d->drive_role == 3) {
|
||||
d->status = BURN_DISC_BLANK;
|
||||
d->current_profile = 0xffff;
|
||||
} else if(d->drive_role == 4) {
|
||||
if (d->media_read_capacity > 0)
|
||||
d->status = BURN_DISC_FULL;
|
||||
else
|
||||
d->status = BURN_DISC_EMPTY;
|
||||
} else if(d->drive_role == 5) {
|
||||
if (stat_ret != -1 && S_ISREG(stbuf.st_mode) &&
|
||||
stbuf.st_size > 0) {
|
||||
d->status = BURN_DISC_APPENDABLE;
|
||||
d->role_5_nwa = stbuf.st_size / 2048 +
|
||||
!!(stbuf.st_size % 2048);
|
||||
} else
|
||||
d->status = BURN_DISC_BLANK;
|
||||
} else {
|
||||
d->status = BURN_DISC_EMPTY;
|
||||
d->current_profile = 0;
|
||||
@ -429,10 +458,12 @@ int burn_drive_unregister(struct burn_drive *d)
|
||||
*/
|
||||
struct burn_drive *burn_drive_finish_enum(struct burn_drive *d)
|
||||
{
|
||||
struct burn_drive *t;
|
||||
char msg[BURN_DRIVE_ADR_LEN + 160];
|
||||
struct burn_drive *t = NULL;
|
||||
char *msg = NULL;
|
||||
int ret;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, BURN_DRIVE_ADR_LEN + 160);
|
||||
|
||||
d->drive_role = 1; /* MMC drive */
|
||||
|
||||
t = burn_drive_register(d);
|
||||
@ -461,6 +492,8 @@ struct burn_drive *burn_drive_finish_enum(struct burn_drive *d)
|
||||
/* ts A60821 */
|
||||
mmc_function_spy(NULL, "enumerate_common : ----- would release ");
|
||||
|
||||
ex:
|
||||
BURN_FREE_MEM(msg);
|
||||
return t;
|
||||
}
|
||||
|
||||
@ -615,13 +648,29 @@ void burn_wait_all(void)
|
||||
|
||||
void burn_disc_erase_sync(struct burn_drive *d, int fast)
|
||||
{
|
||||
/* ts A60924 : libburn/message.c gets obsoleted
|
||||
burn_message_clear_queue();
|
||||
*/
|
||||
int ret;
|
||||
|
||||
burn_print(1, "erasing drive %s %s\n", d->idata->vendor,
|
||||
d->idata->product);
|
||||
|
||||
if (d->drive_role == 5) { /* Random access write-only drive */
|
||||
ret = truncate(d->devname, (off_t) 0);
|
||||
if (ret == -1) {
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
0x00020182,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Cannot truncate disk file for pseudo blanking",
|
||||
0, 0);
|
||||
return;
|
||||
}
|
||||
d->role_5_nwa = 0;
|
||||
d->cancel = 0;
|
||||
d->status = BURN_DISC_BLANK;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
d->progress.sector = 0x10000;
|
||||
return;
|
||||
}
|
||||
|
||||
d->cancel = 0;
|
||||
|
||||
#ifdef Libburn_reset_progress_asynC
|
||||
@ -665,7 +714,9 @@ void burn_disc_format_sync(struct burn_drive *d, off_t size, int flag)
|
||||
int ret, buf_secs, err, i, stages = 1, pbase, pfill, pseudo_sector;
|
||||
off_t num_bufs;
|
||||
char msg[80];
|
||||
struct buffer buf, *buf_mem = d->buffer;
|
||||
struct buffer *buf = NULL, *buf_mem = d->buffer;
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
|
||||
#ifdef Libburn_reset_progress_asynC
|
||||
/* <<< This is now done in async.c */
|
||||
@ -724,7 +775,7 @@ void burn_disc_format_sync(struct burn_drive *d, off_t size, int flag)
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
msg, 0, 0);
|
||||
|
||||
d->buffer = &buf;
|
||||
d->buffer = buf;
|
||||
memset(d->buffer, 0, sizeof(struct buffer));
|
||||
d->buffer->bytes = buf_secs * 2048;
|
||||
d->buffer->sectors = buf_secs;
|
||||
@ -752,6 +803,7 @@ ex:;
|
||||
d->progress.sector = 0x10000;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
d->buffer = buf_mem;
|
||||
BURN_FREE_MEM(buf);
|
||||
}
|
||||
|
||||
|
||||
@ -869,6 +921,11 @@ void burn_drive_cancel(struct burn_drive *d)
|
||||
/* ts B00225 : these mutexes are unnecessary because "= 1" is atomar.
|
||||
pthread_mutex_lock(&d->access_lock);
|
||||
*/
|
||||
if (!d->cancel) {
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
"burn_drive_cancel() was called", 0, 0);
|
||||
}
|
||||
d->cancel = 1;
|
||||
/*
|
||||
pthread_mutex_unlock(&d->access_lock);
|
||||
@ -1049,7 +1106,7 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[],
|
||||
*n_drives = 0;
|
||||
|
||||
/* ts A70907 : wether to scan from scratch or to extend */
|
||||
for (i = 0; i < sizeof(scanned); i++)
|
||||
for (i = 0; i < (int) sizeof(scanned); i++)
|
||||
scanned[i] = 0;
|
||||
if (flag & 1) {
|
||||
burn_drive_free_all();
|
||||
@ -1077,12 +1134,12 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[],
|
||||
"Out of virtual memory", 0, 0);
|
||||
return -1;
|
||||
} else
|
||||
for (i = 0; i <= count; i++) /* invalidate */
|
||||
for (i = 0; i <= (int) count; i++) /* invalidate */
|
||||
(*drives)[i].drive = NULL;
|
||||
} else
|
||||
*drives = NULL;
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
for (i = 0; i < (int) count; ++i) {
|
||||
if (scanned[i / 8] & (1 << (i % 8)))
|
||||
continue; /* device already scanned by previous run */
|
||||
if (drive_array[i].global_index < 0)
|
||||
@ -1354,40 +1411,109 @@ int burn_drive__fd_from_special_adr(char *adr)
|
||||
return fd;
|
||||
}
|
||||
|
||||
/* @param flag bit0= accept read-only files and return 2 in this case
|
||||
bit1= accept write-only files and return 3 in this case
|
||||
*/
|
||||
static int burn_drive__is_rdwr(char *fname, int *stat_ret,
|
||||
struct stat *stbuf_ret,
|
||||
off_t *read_size_ret, int flag)
|
||||
{
|
||||
int fd, is_rdwr = 1, ret, getfl_ret, st_ret, mask;
|
||||
struct stat stbuf;
|
||||
off_t read_size = 0;
|
||||
|
||||
memset(&stbuf, 0, sizeof(struct stat));
|
||||
fd = burn_drive__fd_from_special_adr(fname);
|
||||
if (fd >= 0)
|
||||
st_ret = fstat(fd, &stbuf);
|
||||
else
|
||||
st_ret = stat(fname, &stbuf);
|
||||
if (st_ret != -1) {
|
||||
is_rdwr = burn_os_is_2k_seekrw(fname, 0);
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
read_size = stbuf.st_size;
|
||||
else if (is_rdwr) {
|
||||
ret = burn_os_stdio_capacity(fname, &read_size);
|
||||
if (ret <= 0)
|
||||
read_size = (off_t) 0x7ffffff0 * (off_t) 2048;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_rdwr && fd >= 0) {
|
||||
getfl_ret = fcntl(fd, F_GETFL);
|
||||
|
||||
/*
|
||||
fprintf(stderr, "LIBBURN_DEBUG: burn_drive__is_rdwr: getfl_ret = %lX , O_RDWR = %lX , & = %lX , O_RDONLY = %lX\n", (unsigned long) getfl_ret, (unsigned long) O_RDWR, (unsigned long) (getfl_ret & O_RDWR), (unsigned long) O_RDONLY);
|
||||
*/
|
||||
|
||||
mask = O_RDWR | O_WRONLY | O_RDONLY;
|
||||
|
||||
if (getfl_ret == -1 || (getfl_ret & mask) != O_RDWR)
|
||||
is_rdwr = 0;
|
||||
if ((flag & 1) && getfl_ret != -1 &&
|
||||
(getfl_ret & mask) == O_RDONLY)
|
||||
is_rdwr = 2;
|
||||
if ((flag & 2) && getfl_ret != -1 &&
|
||||
(getfl_ret & mask) == O_WRONLY)
|
||||
is_rdwr = 3;
|
||||
}
|
||||
if (stat_ret != NULL)
|
||||
*stat_ret = st_ret;
|
||||
if (stbuf_ret != NULL)
|
||||
memcpy(stbuf_ret, &stbuf, sizeof(struct stat));
|
||||
if (read_size_ret != NULL)
|
||||
*read_size_ret = read_size;
|
||||
return is_rdwr;
|
||||
}
|
||||
|
||||
|
||||
static int burn_role_by_access(char *fname, int flag)
|
||||
{
|
||||
/* We normally need _LARGEFILE64_SOURCE defined by the build system.
|
||||
Nevertheless the system might use large address integers by default.
|
||||
*/
|
||||
#ifndef O_LARGEFILE
|
||||
#define O_LARGEFILE 0
|
||||
#endif
|
||||
int fd;
|
||||
|
||||
fd = open(fname, O_RDWR | O_LARGEFILE);
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
return 2;
|
||||
}
|
||||
fd = open(fname, O_RDONLY | O_LARGEFILE);
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
return 4;
|
||||
}
|
||||
fd = open(fname, O_WRONLY | O_LARGEFILE);
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
return 5;
|
||||
}
|
||||
if (flag & 1)
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
/* ts A70903 : Implements adquiration of pseudo drives */
|
||||
int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
|
||||
{
|
||||
int ret = -1, fd = -1, role = 0;
|
||||
int is_block_dev = 0;
|
||||
int ret = -1, role = 0, fd;
|
||||
int is_rdwr = 0, stat_ret = -1;
|
||||
/* divided by 512 it needs to fit into a signed long integer */
|
||||
off_t size = ((off_t) (512 * 1024 * 1024 - 1) * (off_t) 2048);
|
||||
off_t read_size = -1;
|
||||
struct burn_drive *d= NULL, *regd_d;
|
||||
struct stat stbuf;
|
||||
|
||||
static int allow_role_3 = 1;
|
||||
|
||||
if (fname[0] != 0) {
|
||||
memset(&stbuf, 0, sizeof(stbuf));
|
||||
fd = burn_drive__fd_from_special_adr(fname);
|
||||
if (fd >= 0)
|
||||
ret = fstat(fd, &stbuf);
|
||||
else
|
||||
ret = stat(fname, &stbuf);
|
||||
if (ret != -1) {
|
||||
is_block_dev = burn_os_is_2k_seekrw(fname, 0);
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
read_size = stbuf.st_size;
|
||||
else if (is_block_dev) {
|
||||
ret = burn_os_stdio_capacity(fname,
|
||||
&read_size);
|
||||
if (ret <= 0)
|
||||
read_size = (off_t) 0x7ffffff0 *
|
||||
(off_t) 2048;
|
||||
}
|
||||
}
|
||||
if (ret == -1 || is_block_dev || S_ISREG(stbuf.st_mode)) {
|
||||
is_rdwr = burn_drive__is_rdwr(fname, &stat_ret, &stbuf,
|
||||
&read_size, 1 | 2);
|
||||
if (stat_ret == -1 || is_rdwr) {
|
||||
ret = burn_os_stdio_capacity(fname, &size);
|
||||
if (ret == -1) {
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
@ -1404,18 +1530,22 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
|
||||
errno, 0);
|
||||
return 0;
|
||||
}
|
||||
if (fname[0] != 0)
|
||||
role = 2;
|
||||
else
|
||||
if (fname[0] != 0) {
|
||||
if (is_rdwr == 2 &&
|
||||
(burn_drive_role_4_allowed & 1))
|
||||
role = 4;
|
||||
else if (is_rdwr == 3 &&
|
||||
(burn_drive_role_4_allowed & 1))
|
||||
role = 5;
|
||||
else
|
||||
role = 2;
|
||||
if (stat_ret != -1 && role == 2 && fd == -1 &&
|
||||
(burn_drive_role_4_allowed & 3) == 3)
|
||||
role = burn_role_by_access(fname,
|
||||
!!(burn_drive_role_4_allowed & 4));
|
||||
} else
|
||||
role = 0;
|
||||
} else {
|
||||
if(S_ISDIR(stbuf.st_mode) || !allow_role_3) {
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
0x00020149,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Unsuitable filetype for pseudo-drive", 0, 0);
|
||||
return 0;
|
||||
}
|
||||
role = 3;
|
||||
}
|
||||
}
|
||||
@ -1436,22 +1566,39 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
|
||||
}
|
||||
free((char *) d); /* all sub pointers have been copied to *regd_d */
|
||||
d = regd_d;
|
||||
if (d->drive_role == 2 || d->drive_role == 3) {
|
||||
d->status = BURN_DISC_BLANK;
|
||||
if (d->drive_role >= 2 && d->drive_role <= 5) {
|
||||
if (d->drive_role == 4) {
|
||||
if (read_size > 0)
|
||||
d->status = BURN_DISC_FULL;
|
||||
else
|
||||
d->status = BURN_DISC_EMPTY;
|
||||
d->block_types[BURN_WRITE_TAO] = 0;
|
||||
d->block_types[BURN_WRITE_SAO] = 0;
|
||||
} else {
|
||||
if (d->drive_role == 5 && stat_ret != -1 &&
|
||||
S_ISREG(stbuf.st_mode) && stbuf.st_size > 0 &&
|
||||
(burn_drive_role_4_allowed & 8)) {
|
||||
d->status = BURN_DISC_APPENDABLE;
|
||||
d->block_types[BURN_WRITE_SAO] = 0;
|
||||
d->role_5_nwa = stbuf.st_size / 2048 +
|
||||
!!(stbuf.st_size % 2048);
|
||||
} else {
|
||||
d->status = BURN_DISC_BLANK;
|
||||
d->block_types[BURN_WRITE_SAO] =
|
||||
BURN_BLOCK_SAO;
|
||||
d->role_5_nwa = 0;
|
||||
}
|
||||
d->block_types[BURN_WRITE_TAO] = BURN_BLOCK_MODE1;
|
||||
}
|
||||
d->current_profile = 0xffff; /* MMC for non-compliant drive */
|
||||
strcpy(d->current_profile_text,"stdio file");
|
||||
d->current_is_cd_profile = 0;
|
||||
d->current_is_supported_profile = 1;
|
||||
d->block_types[BURN_WRITE_TAO] = BURN_BLOCK_MODE1;
|
||||
d->block_types[BURN_WRITE_SAO] = BURN_BLOCK_SAO;
|
||||
if (read_size >= 0)
|
||||
/* despite its name : last valid address, not size */
|
||||
d->media_read_capacity =
|
||||
read_size / 2048 - !(read_size % 2048);
|
||||
burn_drive_set_media_capacity_remaining(d, size);
|
||||
|
||||
/* >>> ? open file for a test ? (>>> beware of "-" = stdin) */;
|
||||
|
||||
} else
|
||||
d->current_profile = 0; /* Drives return this if empty */
|
||||
|
||||
@ -1470,6 +1617,14 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
|
||||
strcpy((*drive_infos)[0].vendor,"YOYODYNE");
|
||||
strcpy((*drive_infos)[0].product,"BLACKHOLE");
|
||||
strcpy((*drive_infos)[0].revision,"FX02");
|
||||
} else if (d->drive_role == 4) {
|
||||
strcpy((*drive_infos)[0].vendor,"YOYODYNE");
|
||||
strcpy((*drive_infos)[0].product,"WARP DRIVE");
|
||||
strcpy((*drive_infos)[0].revision,"FX03");
|
||||
} else if (d->drive_role == 5) {
|
||||
strcpy((*drive_infos)[0].vendor,"YOYODYNE");
|
||||
strcpy((*drive_infos)[0].product,"WARP DRIVE");
|
||||
strcpy((*drive_infos)[0].revision,"FX04");
|
||||
} else {
|
||||
strcpy((*drive_infos)[0].vendor,"FERENGI");
|
||||
strcpy((*drive_infos)[0].product,"VAPORWARE");
|
||||
@ -1550,18 +1705,21 @@ int burn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], char* adr,
|
||||
int burn_drive_adr_debug_msg(char *fmt, char *arg)
|
||||
{
|
||||
int ret;
|
||||
char msg[4096], *msgpt;
|
||||
char *msg = NULL, *msgpt;
|
||||
|
||||
msgpt= msg;
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
msgpt = msg;
|
||||
if(arg != NULL)
|
||||
sprintf(msg, fmt, arg);
|
||||
else
|
||||
msgpt= fmt;
|
||||
msgpt = fmt;
|
||||
if(libdax_messenger == NULL)
|
||||
return 0;
|
||||
ret = libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
msgpt, 0, 0);
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1610,10 +1768,14 @@ int burn_drive_is_enumerable_adr(char *adr)
|
||||
int burn_drive_resolve_link(char *path, char adr[], int *recursion_count,
|
||||
int flag)
|
||||
{
|
||||
int ret;
|
||||
char link_target[4096], msg[4096+100], link_adr[4096], *adrpt;
|
||||
int ret, link_target_size = 4096;
|
||||
char *link_target = NULL, *msg = NULL, *link_adr = NULL, *adrpt;
|
||||
struct stat stbuf;
|
||||
|
||||
BURN_ALLOC_MEM(link_target, char, link_target_size);
|
||||
BURN_ALLOC_MEM(msg, char, link_target_size + 100);
|
||||
BURN_ALLOC_MEM(link_adr, char, link_target_size);
|
||||
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg("burn_drive_resolve_link( %s )",
|
||||
path);
|
||||
@ -1622,24 +1784,24 @@ int burn_drive_resolve_link(char *path, char adr[], int *recursion_count,
|
||||
burn_drive_adr_debug_msg(
|
||||
"burn_drive_resolve_link aborts because link too deep",
|
||||
NULL);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
(*recursion_count)++;
|
||||
ret = readlink(path, link_target, sizeof(link_target));
|
||||
ret = readlink(path, link_target, link_target_size);
|
||||
if (ret == -1) {
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg("readlink( %s ) returns -1",
|
||||
path);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (ret >= sizeof(link_target) - 1) {
|
||||
if (ret >= link_target_size - 1) {
|
||||
sprintf(msg,"readlink( %s ) returns %d (too much)", path, ret);
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg(msg, NULL);
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
}
|
||||
link_target[ret] = 0;
|
||||
adrpt= link_target;
|
||||
adrpt = link_target;
|
||||
if (link_target[0] != '/') {
|
||||
strcpy(link_adr, path);
|
||||
if ((adrpt = strrchr(link_adr, '/')) != NULL) {
|
||||
@ -1667,6 +1829,10 @@ int burn_drive_resolve_link(char *path, char adr[], int *recursion_count,
|
||||
}
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg(msg, NULL);
|
||||
ex:;
|
||||
BURN_FREE_MEM(link_target);
|
||||
BURN_FREE_MEM(msg);
|
||||
BURN_FREE_MEM(link_adr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1674,13 +1840,16 @@ int burn_drive_resolve_link(char *path, char adr[], int *recursion_count,
|
||||
/* Try to find an enumerated address with the given stat.st_rdev number */
|
||||
int burn_drive_find_devno(dev_t devno, char adr[])
|
||||
{
|
||||
char fname[4096], msg[4096+100];
|
||||
int ret = 0, first = 1;
|
||||
char *fname = NULL, *msg = NULL;
|
||||
int ret = 0, first = 1, fname_size = 4096;
|
||||
struct stat stbuf;
|
||||
burn_drive_enumerator_t enm;
|
||||
|
||||
BURN_ALLOC_MEM(fname, char, fname_size);
|
||||
BURN_ALLOC_MEM(msg, char, fname_size + 100);
|
||||
|
||||
while (1) {
|
||||
ret = sg_give_next_adr(&enm, fname, sizeof(fname), first);
|
||||
ret = sg_give_next_adr(&enm, fname, fname_size, first);
|
||||
if(ret <= 0)
|
||||
break;
|
||||
first = 0;
|
||||
@ -1690,7 +1859,7 @@ int burn_drive_find_devno(dev_t devno, char adr[])
|
||||
if(devno != stbuf.st_rdev)
|
||||
continue;
|
||||
if(strlen(fname) >= BURN_DRIVE_ADR_LEN)
|
||||
return -1;
|
||||
{ret= -1; goto ex;}
|
||||
|
||||
sprintf(msg, "burn_drive_find_devno( 0x%lX ) found %s",
|
||||
(long) devno, fname);
|
||||
@ -1701,7 +1870,9 @@ int burn_drive_find_devno(dev_t devno, char adr[])
|
||||
ret = 0;
|
||||
ex:;
|
||||
if (first == 0)
|
||||
sg_give_next_adr(&enm, fname, sizeof(fname), -1);
|
||||
sg_give_next_adr(&enm, fname, fname_size, -1);
|
||||
BURN_FREE_MEM(fname);
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1714,7 +1885,9 @@ int burn_drive_obtain_scsi_adr(char *path,
|
||||
int *target_no, int *lun_no)
|
||||
{
|
||||
int ret, i;
|
||||
char adr[BURN_DRIVE_ADR_LEN];
|
||||
char *adr = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(adr, char, BURN_DRIVE_ADR_LEN);
|
||||
|
||||
/* open drives cannot be inquired by sg_obtain_scsi_adr() */
|
||||
for (i = 0; i < drivetop + 1; i++) {
|
||||
@ -1722,7 +1895,7 @@ int burn_drive_obtain_scsi_adr(char *path,
|
||||
continue;
|
||||
ret = burn_drive_d_get_adr(&(drive_array[i]),adr);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
{ret = 1; goto ex;}
|
||||
if (ret == 0)
|
||||
continue;
|
||||
if (strcmp(adr, path) == 0) {
|
||||
@ -1733,13 +1906,15 @@ int burn_drive_obtain_scsi_adr(char *path,
|
||||
*bus_no = drive_array[i].bus_no;
|
||||
if (*host_no < 0 || *channel_no < 0 ||
|
||||
*target_no < 0 || *lun_no < 0)
|
||||
return 0;
|
||||
return 1;
|
||||
{ret = 0; goto ex;}
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
}
|
||||
|
||||
ret = sg_obtain_scsi_adr(path, bus_no, host_no, channel_no,
|
||||
target_no, lun_no);
|
||||
ex:;
|
||||
BURN_FREE_MEM(adr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1747,17 +1922,20 @@ int burn_drive_obtain_scsi_adr(char *path,
|
||||
int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no,
|
||||
int target_no, int lun_no, char adr[])
|
||||
{
|
||||
char fname[4096],msg[4096+100];
|
||||
int ret = 0, first = 1, i_bus_no = -1;
|
||||
char *fname = NULL, *msg = NULL;
|
||||
int ret = 0, first = 1, i_bus_no = -1, fname_size = 4096;
|
||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||
burn_drive_enumerator_t enm;
|
||||
|
||||
BURN_ALLOC_MEM(fname, char, fname_size);
|
||||
BURN_ALLOC_MEM(msg, char, fname_size + 100);
|
||||
|
||||
sprintf(msg,"burn_drive_convert_scsi_adr( %d,%d,%d,%d,%d )",
|
||||
bus_no, host_no, channel_no, target_no, lun_no);
|
||||
burn_drive_adr_debug_msg(msg, NULL);
|
||||
|
||||
while (1) {
|
||||
ret= sg_give_next_adr(&enm, fname, sizeof(fname), first);
|
||||
ret= sg_give_next_adr(&enm, fname, fname_size, first);
|
||||
if(ret <= 0)
|
||||
break;
|
||||
first = 0;
|
||||
@ -1786,6 +1964,8 @@ int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no,
|
||||
ex:;
|
||||
if (first == 0)
|
||||
sg_give_next_adr(&enm, fname, sizeof(fname), -1);
|
||||
BURN_FREE_MEM(fname);
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2101,6 +2281,11 @@ int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||
return -1;
|
||||
}
|
||||
*lba = *nwa = 0;
|
||||
if (d->drive_role == 5 && trackno == 0 &&
|
||||
d->status == BURN_DISC_APPENDABLE) {
|
||||
*lba = *nwa = d->role_5_nwa;
|
||||
return 1;
|
||||
}
|
||||
if (d->drive_role != 1)
|
||||
return 0;
|
||||
if (o != NULL)
|
||||
@ -2403,7 +2588,7 @@ int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt,
|
||||
o->current_is_cd_profile = d->current_is_cd_profile;
|
||||
o->might_simulate = 0;
|
||||
|
||||
if (d->drive_role == 0)
|
||||
if (d->drive_role == 0 || d->drive_role == 4)
|
||||
return 0;
|
||||
if (d->drive_role == 2) {
|
||||
/* stdio file drive : random access read-write */
|
||||
@ -2411,12 +2596,39 @@ int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt,
|
||||
size = d->media_capacity_remaining;
|
||||
burn_os_stdio_capacity(d->devname, &size);
|
||||
burn_drive_set_media_capacity_remaining(d, size);
|
||||
|
||||
/* >>> This looks wrong ! */
|
||||
/* >>> should add file size */
|
||||
o->start_range_high = size;
|
||||
|
||||
o->start_alignment = 2048; /* imposting a drive, not a file */
|
||||
o->might_do_sao = 4;
|
||||
o->might_do_tao = 2;
|
||||
o->advised_write_mode = BURN_WRITE_TAO;
|
||||
o->might_simulate = 1;
|
||||
} else if (d->drive_role == 5) {
|
||||
/* stdio file drive : random access write-only */
|
||||
o->start_adr = 1;
|
||||
size = d->media_capacity_remaining;
|
||||
burn_os_stdio_capacity(d->devname, &size);
|
||||
burn_drive_set_media_capacity_remaining(d, size);
|
||||
|
||||
/* >>> start_range_low = file size rounded to 2048 */;
|
||||
|
||||
/* >>> This looks wrong ! */
|
||||
/* >>> should add file size */
|
||||
o->start_range_high = size;
|
||||
|
||||
o->start_alignment = 2048; /* imposting a drive, not a file */
|
||||
if (s == BURN_DISC_APPENDABLE) {
|
||||
if (wt == BURN_WRITE_SAO || wt == BURN_WRITE_RAW)
|
||||
return 0;
|
||||
o->might_do_sao = 0;
|
||||
} else
|
||||
o->might_do_sao = 4;
|
||||
o->might_do_tao = 2;
|
||||
o->advised_write_mode = BURN_WRITE_TAO;
|
||||
o->might_simulate = 1;
|
||||
} else if (d->drive_role != 1) {
|
||||
/* stdio file drive : sequential access write-only */
|
||||
o->might_do_sao = 4;
|
||||
@ -2640,49 +2852,88 @@ static int burn__split_path(char *adr, char **dpt, char **npt)
|
||||
int burn_drive_equals_adr(struct burn_drive *d1, char *adr2_in, int role2)
|
||||
{
|
||||
struct stat stbuf1, stbuf2;
|
||||
char adr1[BURN_DRIVE_ADR_LEN], *adr2 = adr2_in;
|
||||
char conv_adr1[BURN_DRIVE_ADR_LEN], conv_adr2[BURN_DRIVE_ADR_LEN];
|
||||
char *adr1 = NULL, *adr2 = adr2_in;
|
||||
char *conv_adr1 = NULL, *conv_adr2 = NULL;
|
||||
char *npt1, *dpt1, *npt2, *dpt2;
|
||||
int role1, stat_ret1, stat_ret2, conv_ret2;
|
||||
int role1, stat_ret1, stat_ret2, conv_ret2, exact_role_matters = 0, fd;
|
||||
int ret;
|
||||
|
||||
BURN_ALLOC_MEM(adr1, char, BURN_DRIVE_ADR_LEN);
|
||||
BURN_ALLOC_MEM(conv_adr1, char, BURN_DRIVE_ADR_LEN);
|
||||
BURN_ALLOC_MEM(conv_adr2, char, BURN_DRIVE_ADR_LEN);
|
||||
|
||||
role1 = burn_drive_get_drive_role(d1);
|
||||
burn_drive_d_get_adr(d1, adr1);
|
||||
stat_ret1 = stat(adr1, &stbuf1);
|
||||
|
||||
/* If one of the candidate paths depicts an open file descriptor then
|
||||
its read-write capability decides about its role and the difference
|
||||
between roles 2 and 3 does matter.
|
||||
*/
|
||||
fd = burn_drive__fd_from_special_adr(d1->devname);
|
||||
if (fd != -1)
|
||||
exact_role_matters = 1;
|
||||
if (strncmp(adr2, "stdio:", 6) == 0) {
|
||||
adr2+= 6;
|
||||
role2 = (!!adr2[0]) * 2;
|
||||
if (adr2[0] == 0) {
|
||||
role2 = 0;
|
||||
} else {
|
||||
fd = burn_drive__fd_from_special_adr(adr2);
|
||||
if (fd != -1)
|
||||
exact_role_matters = 1;
|
||||
ret = burn_drive__is_rdwr(adr2, NULL, NULL, NULL,
|
||||
1 | 2);
|
||||
if (ret == 2 && (burn_drive_role_4_allowed & 1))
|
||||
role2 = 4;
|
||||
else if (ret == 3 && (burn_drive_role_4_allowed & 1))
|
||||
role2 = 5;
|
||||
else if (ret > 0)
|
||||
role2 = 2;
|
||||
else
|
||||
role2 = 3;
|
||||
if (fd == -1 &&
|
||||
role2 == 2 && (burn_drive_role_4_allowed & 3) == 3)
|
||||
role2 = burn_role_by_access(adr2,
|
||||
!!(burn_drive_role_4_allowed & 4));
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(adr2) >= BURN_DRIVE_ADR_LEN)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
stat_ret2 = stat(adr2, &stbuf2);
|
||||
conv_ret2 = burn_drive_convert_fs_adr(adr2, conv_adr2);
|
||||
|
||||
/* roles 2 and 3 have the same name space and object interpretation */
|
||||
if (role1 == 3)
|
||||
role1 = 2;
|
||||
if (role2 == 3)
|
||||
role2 = 2;
|
||||
if (!exact_role_matters) {
|
||||
/* roles >= 2 have the same name space and object
|
||||
interpretation */
|
||||
if (role1 >= 2)
|
||||
role1 = 2;
|
||||
if (role2 >= 2)
|
||||
role2 = 2;
|
||||
}
|
||||
|
||||
if (strcmp(adr1, adr2) == 0 && role1 == role2)
|
||||
return(1); /* equal role and address */
|
||||
{ret = 1; goto ex;} /* equal role and address */
|
||||
if (role1 == 1 && role2 == 1) {
|
||||
/* MMC drive meets wannabe MMC drive */
|
||||
if (conv_ret2 <= 0)
|
||||
return 0; /* no MMC drive at adr2 */
|
||||
{ret = 0; goto ex;} /* no MMC drive at adr2 */
|
||||
if (strcmp(adr1, conv_adr2) == 0)
|
||||
return 1; /* equal real MMC drives */
|
||||
return 0;
|
||||
{ret = 1; goto ex;} /* equal real MMC drives */
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
} else if (role1 == 0 || role2 == 0)
|
||||
return 0; /* one null-drive, one not */
|
||||
{ret = 0; goto ex;} /* one null-drive, one not */
|
||||
|
||||
else if (role1 != 1 && role2 != 1) {
|
||||
/* pseudo-drive meets file object */
|
||||
|
||||
if (role1 != role2)
|
||||
{ret = 0; goto ex;}
|
||||
if (stat_ret1 == -1 || stat_ret2 == -1) {
|
||||
if (stat_ret1 != -1 || stat_ret2 != -1)
|
||||
return 0; /* one adress existing, one not */
|
||||
{ret = 0; goto ex;}
|
||||
/* one adress existing, one not */
|
||||
|
||||
/* Two non-existing file objects */
|
||||
|
||||
@ -2691,11 +2942,12 @@ int burn_drive_equals_adr(struct burn_drive *d1, char *adr2_in, int role2)
|
||||
strcpy(conv_adr2, adr2);
|
||||
burn__split_path(conv_adr2, &dpt2, &npt2);
|
||||
if (strcmp(npt1, npt2))
|
||||
return 0; /* basenames differ */
|
||||
{ret = 0; goto ex;} /* basenames differ */
|
||||
stat_ret1= stat(adr1, &stbuf1);
|
||||
stat_ret2= stat(adr2, &stbuf2);
|
||||
if (stat_ret1 != stat_ret2)
|
||||
return 0; /* one dir existing, one not */
|
||||
{ret = 0; goto ex;}
|
||||
/* one dir existing, one not */
|
||||
|
||||
/* Both directories exist. The basenames are equal.
|
||||
So the adresses are equal if the directories are
|
||||
@ -2703,47 +2955,52 @@ int burn_drive_equals_adr(struct burn_drive *d1, char *adr2_in, int role2)
|
||||
}
|
||||
if (stbuf1.st_ino == stbuf2.st_ino &&
|
||||
stbuf1.st_dev == stbuf2.st_dev)
|
||||
return 1; /* same filesystem object */
|
||||
{ret = 1; goto ex;} /* same filesystem object */
|
||||
|
||||
if (S_ISBLK(stbuf1.st_mode) && S_ISBLK(stbuf2.st_mode) &&
|
||||
stbuf1.st_rdev == stbuf2.st_rdev)
|
||||
return 1; /* same major,minor device number */
|
||||
{ret = 1; goto ex;}/* same major,minor device number */
|
||||
if (S_ISCHR(stbuf1.st_mode) && S_ISCHR(stbuf2.st_mode) &&
|
||||
stbuf1.st_rdev == stbuf2.st_rdev)
|
||||
return 1; /* same major,minor device number */
|
||||
{ret = 1; goto ex;}/* same major,minor device number */
|
||||
|
||||
/* Are both filesystem objects related to the same MMC drive */
|
||||
if (conv_ret2 <= 0)
|
||||
return 0; /* no MMC drive at adr2 */
|
||||
{ret = 0; goto ex;} /* no MMC drive at adr2 */
|
||||
if (burn_drive_convert_fs_adr(adr1, conv_adr1) <= 0)
|
||||
return 0; /* no MMC drive at adr1 */
|
||||
{ret = 0; goto ex;} /* no MMC drive at adr1 */
|
||||
if (strcmp(conv_adr1, conv_adr2) == 0)
|
||||
return 1; /* same MMC drive */
|
||||
{ret = 1; goto ex;} /* same MMC drive */
|
||||
|
||||
return 0; /* all filesystem disguises are checked */
|
||||
{ret = 0; goto ex;} /* all filesystem disguises are checked */
|
||||
|
||||
} else if (role1 == 1 && role2 != 1) {
|
||||
/* MMC drive meets file object */
|
||||
|
||||
if (conv_ret2 <= 0)
|
||||
return 0; /* no MMC drive at adr2 */
|
||||
{ret = 0; goto ex;} /* no MMC drive at adr2 */
|
||||
if (strcmp(adr1, conv_adr2) == 0)
|
||||
return 1; /* same MMC drive */
|
||||
return 0;
|
||||
{ret = 1; goto ex;} /* same MMC drive */
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
} else if (role1 != 1 && role2 == 1) {
|
||||
/* stdio-drive meets wannabe MMC drive */
|
||||
|
||||
if (conv_ret2 <= 0)
|
||||
return 0; /* no MMC drive at adr2 */
|
||||
{ret = 0; goto ex;} /* no MMC drive at adr2 */
|
||||
if (burn_drive_convert_fs_adr(adr1, conv_adr1) <= 0)
|
||||
return 0; /* no MMC drive at adr1 */
|
||||
{ret = 0; goto ex;} /* no MMC drive at adr1 */
|
||||
if (strcmp(conv_adr1, conv_adr2) == 0)
|
||||
return 1; /* same MMC drive */
|
||||
return 0;
|
||||
{ret = 1; goto ex;} /* same MMC drive */
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
}
|
||||
return 0; /* now i believe they are really not equal */
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(adr1);
|
||||
BURN_FREE_MEM(conv_adr1);
|
||||
BURN_FREE_MEM(conv_adr2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -2851,3 +3108,11 @@ int burn_disc_get_bd_spare_info(struct burn_drive *d,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* ts B10525 : API */
|
||||
int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag)
|
||||
{
|
||||
return d->next_track_damaged;
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "libburn.h"
|
||||
#include "toc.h"
|
||||
#include "structure.h"
|
||||
#include <pthread.h>
|
||||
|
||||
struct burn_drive;
|
||||
struct command;
|
||||
|
@ -211,9 +211,10 @@ struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size)
|
||||
|
||||
static int fifo_sleep(int flag)
|
||||
{
|
||||
static struct timespec sleeptime = { 0, 50000000}; /* 50 ms */
|
||||
static unsigned long sleeptime = 50000; /* 50 ms */
|
||||
|
||||
return nanosleep(&sleeptime, NULL);
|
||||
usleep(sleeptime);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -105,6 +105,14 @@ int burn_support_untested_profiles = 0;
|
||||
*/
|
||||
int burn_sg_log_scsi = 0;
|
||||
|
||||
|
||||
/* ts B10312 :
|
||||
Whether to map random-access readonly files to drive role 4.
|
||||
Else it is role 2 overwriteable drive
|
||||
*/
|
||||
int burn_drive_role_4_allowed = 0;
|
||||
|
||||
|
||||
/* ts A60925 : ticket 74 */
|
||||
/** Create the messenger object for libburn. */
|
||||
int burn_msgs_initialize(void)
|
||||
@ -169,6 +177,8 @@ void burn_finish(void)
|
||||
|
||||
sg_shutdown(0);
|
||||
|
||||
burn_drive_clear_whitelist();
|
||||
|
||||
burn_running = 0;
|
||||
}
|
||||
|
||||
@ -344,7 +354,7 @@ char *burn_util_thread_id(pid_t pid, pthread_t tid, char text[80])
|
||||
|
||||
sprintf(text, "[%lu,", (unsigned long int) getpid());
|
||||
l= strlen(text);
|
||||
for(i= 0; i < sizeof(pthread_t) && 2 * i < 80 - l - 3; i++)
|
||||
for(i= 0; i < ((int) sizeof(pthread_t)) && 2 * i < 80 - l - 3; i++)
|
||||
sprintf(text + l + 2 * i,
|
||||
"%2.2X", ((unsigned char *) &tid)[i]);
|
||||
|
||||
@ -565,3 +575,25 @@ void burn_set_scsi_logging(int flag)
|
||||
{
|
||||
burn_sg_log_scsi = flag & 7;
|
||||
}
|
||||
|
||||
|
||||
/* ts B10312 API */
|
||||
void burn_allow_drive_role_4(int allowed)
|
||||
{
|
||||
burn_drive_role_4_allowed = (allowed & 0xf);
|
||||
}
|
||||
|
||||
|
||||
/* ts B10606 */
|
||||
void *burn_alloc_mem(size_t size, size_t count, int flag)
|
||||
{
|
||||
void *pt;
|
||||
|
||||
pt = calloc(size, count);
|
||||
if(pt == NULL)
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000003,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Out of virtual memory", 0, 0);
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
@ -27,5 +27,19 @@ extern volatile int burn_builtin_triggered_action; /* burn_is_aborting() */
|
||||
*/
|
||||
int burn_init_catch_on_abort(int flag);
|
||||
|
||||
/* ts B10606 */
|
||||
void *burn_alloc_mem(size_t size, size_t count, int flag);
|
||||
|
||||
#define BURN_ALLOC_MEM(pt, typ, count) { \
|
||||
pt= (typ *) burn_alloc_mem(sizeof(typ), (size_t) (count), 0); \
|
||||
if(pt == NULL) { \
|
||||
ret= -1; goto ex; \
|
||||
} }
|
||||
|
||||
#define BURN_FREE_MEM(pt) { \
|
||||
if(pt != NULL) \
|
||||
free((char *) pt); \
|
||||
}
|
||||
|
||||
|
||||
#endif /* BURN__INIT_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
This is the official API definition of libburn.
|
||||
@ -1279,6 +1279,45 @@ int burn_disc_get_bd_spare_info(struct burn_drive *d,
|
||||
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||
int trackno, int *lba, int *nwa);
|
||||
|
||||
/* ts B10525 */
|
||||
/** Tells whether a previous attempt to determine the Next Writeable Address
|
||||
of the upcomming track reveiled that the READ TRACK INFORMATION Damage Bit
|
||||
is set for this track, resp. that no valid writable address is available.
|
||||
See MMC-5 6.27.3.7 Damage Bit, 6.27.3.11 NWA_V (NWA valid)
|
||||
@param d The drive to query.
|
||||
@param flag Bitfield for control purposes (unused yet, submit 0)
|
||||
@return 0= Looks ok: Damage Bit is not set, NWA_V is set
|
||||
1= Damaged and theoretically writable (NWA_V is set)
|
||||
2= Not writable: NWA_V is not set
|
||||
3= Damaged and not writable (NWA_V is not set),
|
||||
@since 1.1.0
|
||||
*/
|
||||
int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag);
|
||||
|
||||
/* ts B10527 */
|
||||
/** Try to close the last track and session of media which have bit0 set in
|
||||
the return value of call burn_disc_next_track_is_damaged().
|
||||
Whether it helps depends much on the reason why the media is reported
|
||||
as damaged by the drive.
|
||||
This call works only for profiles 0x09 CD-R, 0x0a CD-RW, 0x11 DVD-R,
|
||||
0x14 DVD-RW sequential, 0x1b DVD+R, 0x2b DVD+R DL, 0x41 BD-R sequential.
|
||||
Note: After writing it is advised to give up the drive and to grab it again
|
||||
in order to learn about its view on the new media state.
|
||||
@param o Write options created by burn_write_opts_new() and
|
||||
manipulated by burn_write_opts_set_multi().
|
||||
burn_write_opts_set_write_type() should be set to
|
||||
BURN_WRITE_TAO, burn_write_opts_set_simulate() should be
|
||||
set to 0.
|
||||
@param flag Bitfield for control purposes
|
||||
bit0= force close, even if no damage was seen
|
||||
@return <=0 media not marked as damaged, or media type not suitable,
|
||||
or closing attempted but failed
|
||||
1= attempt finished without error indication
|
||||
@since 1.1.0
|
||||
*/
|
||||
int burn_disc_close_damaged(struct burn_write_opts *o, int flag);
|
||||
|
||||
|
||||
/* ts A70131 */
|
||||
/** Read start lba of the first track in the last complete session.
|
||||
This is the first parameter of mkisofs option -C. The second parameter
|
||||
@ -1308,7 +1347,6 @@ int burn_disc_get_msc1(struct burn_drive *d, int *start_lba);
|
||||
off_t burn_disc_available_space(struct burn_drive *d,
|
||||
struct burn_write_opts *o);
|
||||
|
||||
|
||||
/* ts A61202 */
|
||||
/** Tells the MMC Profile identifier of the loaded media. The drive must be
|
||||
grabbed in order to get a non-zero result.
|
||||
@ -1448,6 +1486,8 @@ void burn_read_opts_free(struct burn_read_opts *opts);
|
||||
cancellable, as control of the operation is passed wholly to the drive and
|
||||
there is no way to interrupt it safely.
|
||||
@param drive The drive with which to erase a disc.
|
||||
Only drive roles 1 (MMC) and 5 (stdio random write-only)
|
||||
support erasing.
|
||||
@param fast Nonzero to do a fast erase, where only the disc's headers are
|
||||
erased; zero to erase the entire disc.
|
||||
With DVD-RW, fast blanking yields media capable only of DAO.
|
||||
@ -1592,8 +1632,13 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
|
||||
To be set by burn_write_opts_set_write_type().
|
||||
Note: This function is not suitable for overwriting data in the middle of
|
||||
a valid data area because it is allowed to append trailing data.
|
||||
For exact random access overwriting use burn_random_access_write().
|
||||
a valid data area because it is allowed to append trailing data.
|
||||
For exact random access overwriting use burn_random_access_write().
|
||||
Note: After writing it is advised to give up the drive and to grab it again
|
||||
in order to learn about its view on the new media state.
|
||||
Note: Before mounting the written media it might be necessary to eject
|
||||
and reload in order to allow the operating system to notice the new
|
||||
media state.
|
||||
@param o The options for the writing operation.
|
||||
@param disc The struct burn_disc * that described the disc to be created
|
||||
*/
|
||||
@ -2214,7 +2259,7 @@ void burn_write_opts_set_format(struct burn_write_opts *opts, int format);
|
||||
This corresponds to the Test Write bit in MMC mode page 05h. Several media
|
||||
types do not support this. See struct burn_multi_caps.might_simulate for
|
||||
actual availability of this feature.
|
||||
If the media is suitable, the drive will perform burn_write_disc() as a
|
||||
If the media is suitable, the drive will perform burn_disc_write() as a
|
||||
simulation instead of effective write operations. This means that the
|
||||
media content and burn_disc_get_status() stay unchanged.
|
||||
Note: With stdio-drives, the target file gets eventually created, opened,
|
||||
@ -2690,8 +2735,8 @@ void burn_version(int *major, int *minor, int *micro);
|
||||
}
|
||||
|
||||
*/
|
||||
#define burn_header_version_major 0
|
||||
#define burn_header_version_minor 9
|
||||
#define burn_header_version_major 1
|
||||
#define burn_header_version_minor 1
|
||||
#define burn_header_version_micro 0
|
||||
/** Note:
|
||||
Above version numbers are also recorded in configure.ac because libtool
|
||||
@ -2996,15 +3041,20 @@ int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag);
|
||||
bit0= - reserved -
|
||||
bit1= do not submit error message if read error
|
||||
bit2= on error do not try to read a second time
|
||||
with single block steps. @since 0.5.2
|
||||
with single block steps.
|
||||
@since 0.5.2
|
||||
bit3= return -2 on permission denied error rather than
|
||||
issueing a warning message.
|
||||
@since 1.0.6
|
||||
@return 1=sucessful , <=0 an error occured
|
||||
with bit3: -2= permission denied error
|
||||
@since 0.4.0
|
||||
*/
|
||||
int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
char data[], off_t data_size, off_t *data_count, int flag);
|
||||
|
||||
|
||||
/* A70904 */
|
||||
/* ts A70904 */
|
||||
/** Inquire whether the drive object is a real MMC drive or a pseudo-drive
|
||||
created by a stdio: address.
|
||||
@param d The drive to inquire
|
||||
@ -3012,11 +3062,47 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
1= real MMC drive
|
||||
2= stdio-drive, random access, read-write
|
||||
3= stdio-drive, sequential, write-only
|
||||
4= stdio-drive, random access, read-only
|
||||
(only if enabled by burn_allow_drive_role_4())
|
||||
@since 0.4.0
|
||||
*/
|
||||
int burn_drive_get_drive_role(struct burn_drive *d);
|
||||
|
||||
|
||||
/* ts B10312 */
|
||||
/** Allow drive role 4 "random access read-only"
|
||||
and drive role 5 "random access write-only".
|
||||
By default a random access file assumes drive role 2 "read-write"
|
||||
regardless whether it is actually readable or writeable.
|
||||
If enabled, random-access file objects which recognizably allow no
|
||||
writing will be classified as role 4 and those which allow no reading
|
||||
will get role 5.
|
||||
Candidates are drive addresses of the form stdio:/dev/fd/# , where # is
|
||||
the integer number of an open file descriptor. If this descriptor was
|
||||
opened read-only resp. write-only, then it gets role 4 resp. role 5.
|
||||
Other paths may get tested by an attempt to open them for read-write
|
||||
(role 2) resp. read-only (role 4) resp. write-only (role 5). See bit1.
|
||||
@param allowed Bitfield for control purposes:
|
||||
bit0= Enable roles 4 and 5 for drives which get
|
||||
aquired after this call
|
||||
bit1= with bit0:
|
||||
Test whether the file can be opened for
|
||||
read-write resp. read-only resp. write-only.
|
||||
Classify as roles 2 resp. 4 resp. 5.
|
||||
bit2= with bit0 and bit1:
|
||||
Classify files which cannot be opened at all
|
||||
as role 0 : useless dummy.
|
||||
Else classify as role 2.
|
||||
bit3= Classify non-empty role 5 drives as
|
||||
BURN_DISC_APPENDABLE with Next Writeable Address
|
||||
after the end of the file. It is nevertheless
|
||||
possible to change this address by call
|
||||
burn_write_opts_set_start_byte().
|
||||
@since 1.0.6
|
||||
*/
|
||||
void burn_allow_drive_role_4(int allowed);
|
||||
|
||||
|
||||
/* ts A70923 */
|
||||
/** Find out whether a given address string would lead to the given drive
|
||||
object. This should be done in advance for track source addresses
|
||||
|
@ -2,9 +2,11 @@ LIBBURN4 {
|
||||
global:
|
||||
burn_abort;
|
||||
burn_abort_pacifier;
|
||||
burn_allow_drive_role_4;
|
||||
burn_allow_untested_profiles;
|
||||
burn_disc_add_session;
|
||||
burn_disc_available_space;
|
||||
burn_disc_close_damaged;
|
||||
burn_disc_create;
|
||||
burn_disc_erasable;
|
||||
burn_disc_erase;
|
||||
@ -22,6 +24,7 @@ burn_disc_get_profile;
|
||||
burn_disc_get_sectors;
|
||||
burn_disc_get_sessions;
|
||||
burn_disc_get_status;
|
||||
burn_disc_next_track_is_damaged;
|
||||
burn_disc_pretend_blank;
|
||||
burn_disc_pretend_full;
|
||||
burn_disc_read;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* libdax_msgs
|
||||
Message handling facility of libdax.
|
||||
Copyright (C) 2006-2010 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
Copyright (C) 2006-2011 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -519,7 +519,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
|
||||
0x0002014d (SORRY,HIGH) = Asynchromous SCSI error
|
||||
0x0002014f (SORRY,HIGH) = Timeout with asynchromous SCSI command
|
||||
0x00020150 (DEBUG,LOW) = Reporting asynchronous waiting time
|
||||
0x00020151 (FATAL,HIGH) = Read attempt on write-only drive
|
||||
0x00020151 (FAILURE,HIGH) = Read attempt on write-only drive
|
||||
0x00020152 (FATAL,HIGH) = Cannot start fifo thread
|
||||
0x00020153 (SORRY,HIGH) = Read error on fifo input
|
||||
0x00020154 (NOTE,HIGH) = Forwarded input error ends output
|
||||
@ -565,6 +565,15 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
|
||||
0x0002017d (FATAL,HIGH) = Invalid file descriptor with stdio pseudo-drive
|
||||
0x0002017e (FAILURE,HIGH) = Failed to close track, session, or disc
|
||||
0x0002017f (FAILURE,HIGH) = Failed to synchronize drive cache
|
||||
0x00020180 (FAILURE,HIGH) = Premature end of input encountered
|
||||
0x00020181 (FAILURE,HIGH) = Pseudo-drive is a read-only file. Cannot write.
|
||||
0x00020182 (FAILURE,HIGH) = Cannot truncate disk file for pseudo blanking
|
||||
0x00020183 (WARNING,HIGH) = Failed to open device (a pseudo-drive) for reading
|
||||
0x00020184 (WARNING,HIGH) = No Next-Writable-Address
|
||||
0x00020185 (WARNING,HIGH) = Track damaged, not closed and not writable
|
||||
0x00020186 (WARNING,HIGH) = Track damaged and not closed
|
||||
0x00020187 (NOTE,HIGH) = Track not marked as damaged. No action taken.
|
||||
0x00020188 (FAILURE,HIGH) = Cannot close damaged track on given media type
|
||||
|
||||
libdax_audioxtr:
|
||||
0x00020200 (SORRY,HIGH) = Cannot open audio source file
|
||||
|
1476
libburn/mmc.c
1476
libburn/mmc.c
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -54,7 +54,7 @@ void burn_disc_read(struct burn_drive *d, const struct burn_read_opts *o)
|
||||
int drive_lba;
|
||||
unsigned short crc;
|
||||
unsigned char fakesub[96];
|
||||
struct buffer page;
|
||||
struct buffer page; <- needs to become dynamic memory
|
||||
int speed;
|
||||
|
||||
/* ts A61007 : if this function gets revived, then these
|
||||
@ -286,8 +286,12 @@ void burn_packet_process(struct burn_drive *d, unsigned char *data,
|
||||
/* so yeah, when you uncomment these, make them write zeros insted of crap
|
||||
static void write_empty_sector(int fd)
|
||||
{
|
||||
char sec[2352];
|
||||
static char sec[2352], initialized = 0;
|
||||
|
||||
if (!initialized) {
|
||||
memset(sec, 0, 2352);
|
||||
initialized = 1;
|
||||
}
|
||||
burn_print(1, "writing an 'empty' sector\n");
|
||||
write(fd, sec, 2352);
|
||||
}
|
||||
@ -339,7 +343,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
int alignment = 2048, start, upto, chunksize = 1, err, cpy_size, i;
|
||||
int sose_mem = 0, fd = -1, ret;
|
||||
char msg[81], *wpt;
|
||||
struct buffer buf, *buffer_mem = d->buffer;
|
||||
struct buffer *buf = NULL, *buffer_mem = d->buffer;
|
||||
|
||||
/*
|
||||
#define Libburn_read_data_adr_logginG 1
|
||||
@ -353,7 +357,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
fprintf(log_fp, "%d\n", (int) (byte_address / 2048));
|
||||
#endif /* Libburn_read_data_logginG */
|
||||
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
*data_count = 0;
|
||||
sose_mem = d->silent_on_scsi_error;
|
||||
|
||||
@ -362,20 +366,20 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
d->global_index, 0x00020142,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is not grabbed on random access read", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (d->drive_role == 0) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020146,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is a virtual placeholder (null-drive)", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
} else if (d->drive_role == 3) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020151,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Read attempt on write-only drive", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if ((byte_address % alignment) != 0) {
|
||||
sprintf(msg,
|
||||
@ -385,7 +389,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
0x00020143,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (d->media_read_capacity != 0x7fffffff && byte_address >=
|
||||
((off_t) d->media_read_capacity + (off_t) 1) * (off_t) 2048) {
|
||||
@ -399,7 +403,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
}
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
if (d->busy != BURN_DRIVE_IDLE) {
|
||||
@ -407,7 +411,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
d->global_index, 0x00020145,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is busy on attempt to read data", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
if (d->drive_role != 1) {
|
||||
@ -423,28 +427,41 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
d->stdio_fd = fd =
|
||||
open(d->devname, O_RDONLY | O_LARGEFILE);
|
||||
if (fd == -1) {
|
||||
if (errno != ENOENT || !(flag & 2))
|
||||
if (errno == EACCES && (flag & 2)) {
|
||||
if (!(flag & 8))
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020183,
|
||||
LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Failed to open device (a pseudo-drive) for reading",
|
||||
errno, 0);
|
||||
} else if (errno!= ENOENT || !(flag & 2))
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index,
|
||||
0x00020005,
|
||||
d->global_index, 0x00020005,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Failed to open device (a pseudo-drive) for reading",
|
||||
errno, 0);
|
||||
ret = 0; goto ex;
|
||||
ret = 0;
|
||||
if (errno == EACCES && (flag & 8))
|
||||
ret= -2;
|
||||
goto ex;
|
||||
}
|
||||
if (lseek(fd, byte_address, SEEK_SET) == -1) {
|
||||
if (!(flag & 2))
|
||||
if (!(flag & 2)) {
|
||||
sprintf(msg, "Cannot address start byte %.f",
|
||||
(double) byte_address);
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index,
|
||||
0x00020147,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Cannot address start byte", errno, 0);
|
||||
msg, errno, 0);
|
||||
}
|
||||
ret = 0; goto ex;
|
||||
}
|
||||
}
|
||||
|
||||
d->busy = BURN_DRIVE_READING_SYNC;
|
||||
d->buffer = &buf;
|
||||
d->buffer = buf;
|
||||
|
||||
start = byte_address / 2048;
|
||||
upto = start + data_size / 2048;
|
||||
@ -511,10 +528,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
|
||||
ret = 1;
|
||||
ex:;
|
||||
/* <<< let it open until drive is given up or writing shall happen
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
*/
|
||||
BURN_FREE_MEM(buf);
|
||||
d->buffer = buffer_mem;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
return ret;
|
||||
|
@ -54,20 +54,21 @@ static unsigned char SBC_STOP_UNIT[] = { 0x1b, 0, 0, 0, 0, 0 };
|
||||
|
||||
void sbc_load(struct burn_drive *d)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "load") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(&c, SBC_LOAD, sizeof(SBC_LOAD));
|
||||
c.retry = 1;
|
||||
scsi_init_command(c, SBC_LOAD, sizeof(SBC_LOAD));
|
||||
c->retry = 1;
|
||||
|
||||
/* ts A70921 : Had to revoke Immed because of LG GSA-4082B */
|
||||
/* c.opcode[1] |= 1; / * ts A70918 : Immed */
|
||||
/* c->opcode[1] |= 1; / * ts A70918 : Immed */
|
||||
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
if (c.error)
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
if (c->error)
|
||||
return;
|
||||
/* ts A70923 : Needed regardless of Immed bit. Was once 1 minute, now
|
||||
5 minutes for loading. If this does not suffice then other commands
|
||||
@ -77,20 +78,21 @@ void sbc_load(struct burn_drive *d)
|
||||
|
||||
void sbc_eject(struct burn_drive *d)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "eject") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(&c, SBC_UNLOAD, sizeof(SBC_UNLOAD));
|
||||
/* c.opcode[1] |= 1; / * ts A70918 : Immed , ts B00109 : revoked */
|
||||
c.page = NULL;
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
scsi_init_command(c, SBC_UNLOAD, sizeof(SBC_UNLOAD));
|
||||
/* c->opcode[1] |= 1; / * ts A70918 : Immed , ts B00109 : revoked */
|
||||
c->page = NULL;
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
/* ts A70918 : Wait long. A late eject could surprise or hurt user.
|
||||
ts B00109 : Asynchronous eject revoked, as one cannot reliably
|
||||
distinguish out from unready.
|
||||
if (c.error)
|
||||
if (c->error)
|
||||
return;
|
||||
spc_wait_unit_attention(d, 1800, "STOP UNIT (+ EJECT)", 0);
|
||||
*/
|
||||
@ -102,18 +104,19 @@ void sbc_eject(struct burn_drive *d)
|
||||
*/
|
||||
int sbc_start_unit_flag(struct burn_drive *d, int flag)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
int ret;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "start_unit") <= 0)
|
||||
return 0;
|
||||
|
||||
scsi_init_command(&c, SBC_START_UNIT, sizeof(SBC_START_UNIT));
|
||||
c.retry = 1;
|
||||
c.opcode[1] |= (flag & 1); /* ts A70918 : Immed */
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
if (c.error)
|
||||
scsi_init_command(c, SBC_START_UNIT, sizeof(SBC_START_UNIT));
|
||||
c->retry = 1;
|
||||
c->opcode[1] |= (flag & 1); /* ts A70918 : Immed */
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
if (c->error)
|
||||
return 0;
|
||||
if (!(flag & 1))
|
||||
return 1;
|
||||
@ -144,18 +147,19 @@ int sbc_start_unit(struct burn_drive *d)
|
||||
/* ts A90824 : Trying to reduce drive noise */
|
||||
int sbc_stop_unit(struct burn_drive *d)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
int ret;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "stop_unit") <= 0)
|
||||
return 0;
|
||||
|
||||
scsi_init_command(&c, SBC_STOP_UNIT, sizeof(SBC_STOP_UNIT));
|
||||
c.retry = 0;
|
||||
c.opcode[1] |= 1; /* Immed */
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
if (c.error)
|
||||
scsi_init_command(c, SBC_STOP_UNIT, sizeof(SBC_STOP_UNIT));
|
||||
c->retry = 0;
|
||||
c->opcode[1] |= 1; /* Immed */
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
if (c->error)
|
||||
return 0;
|
||||
ret = spc_wait_unit_attention(d, 1800, "STOP UNIT", 0);
|
||||
d->is_stopped = 1;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -179,10 +179,22 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
|
||||
if (!shortage)
|
||||
goto ex;
|
||||
|
||||
/* ts A61031 */
|
||||
/* ts A61031 - B10103 */
|
||||
if (shortage >= count)
|
||||
track->track_data_done = 1;
|
||||
if (track->open_ended)
|
||||
if (track->end_on_premature_eoi && shortage >= count &&
|
||||
!track->open_ended) {
|
||||
char msg[80];
|
||||
/* Memorize that premature end of input happened */
|
||||
sprintf(msg,
|
||||
"Premature end of input encountered. Missing: %d bytes",
|
||||
shortage);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00020180,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0,0);
|
||||
track->end_on_premature_eoi = 2;
|
||||
}
|
||||
if (track->open_ended || track->end_on_premature_eoi)
|
||||
goto ex;
|
||||
|
||||
/* If we're still short, and there's a "next" pointer, we pull from that.
|
||||
@ -688,7 +700,7 @@ int sector_data(struct burn_write_opts *o, struct burn_track *t, int psub)
|
||||
return 0;
|
||||
|
||||
/* ts A61031 */
|
||||
if (t->open_ended && t->track_data_done) {
|
||||
if ((t->open_ended || t->end_on_premature_eoi) && t->track_data_done) {
|
||||
unget_sector(o, t->mode);
|
||||
return 2;
|
||||
}
|
||||
|
@ -251,9 +251,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
struct statvfs vfsbuf;
|
||||
#endif
|
||||
|
||||
char testpath[4096], *cpt;
|
||||
char *testpath = NULL, *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
int ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
@ -267,18 +270,18 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
|
||||
#ifdef Libburn_if_this_was_linuX
|
||||
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* Libburn_if_this_was_linuX */
|
||||
@ -287,25 +290,28 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
if (testpath[0]) {
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
#endif /* ! Libburn_os_has_stavtfS */
|
||||
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,7 +160,7 @@ static int sg_init_enumerator(burn_drive_enumerator_t *idx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bzero(&(idx->ccb), sizeof(union ccb));
|
||||
memset(&(idx->ccb), 0, sizeof(union ccb));
|
||||
|
||||
idx->ccb.ccb_h.path_id = CAM_XPT_PATH_ID;
|
||||
idx->ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
|
||||
@ -720,11 +720,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
struct statvfs vfsbuf;
|
||||
char testpath[4096], *cpt;
|
||||
char *testpath = NULL, *cpt;
|
||||
long blocks;
|
||||
int open_mode = O_RDWR, fd, ret;
|
||||
off_t add_size = 0;
|
||||
int fd, ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
@ -737,38 +738,52 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
|
||||
#ifdef Libburn_if_this_was_linuX
|
||||
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
int open_mode = O_RDWR, fd, ret;
|
||||
|
||||
if(burn_sg_open_o_excl)
|
||||
open_mode |= O_EXCL;
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* Libburn_if_this_was_linuX */
|
||||
|
||||
|
||||
} else if(S_ISCHR(stbuf.st_mode)) {
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size;
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -174,7 +175,7 @@ static int sg_init_enumerator(burn_drive_enumerator_t *idx_)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bzero(&(idx->ccb), sizeof(union ccb));
|
||||
memset(&(idx->ccb), 0, sizeof(union ccb));
|
||||
|
||||
idx->ccb.ccb_h.path_id = CAM_XPT_PATH_ID;
|
||||
idx->ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
|
||||
@ -673,8 +674,9 @@ static int freebsd_dev_lock(int dev_fd, char *devname,
|
||||
static int sg_lock(struct burn_drive *d, int flag)
|
||||
{
|
||||
int ret, os_errno, pass_dev_no = -1, flock_fd = -1;
|
||||
char msg[4096];
|
||||
char *msg = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
ret = freebsd_dev_lock(d->cam->fd, d->devname,
|
||||
&os_errno, &pass_dev_no, &flock_fd, msg, 0);
|
||||
if (ret <= 0) {
|
||||
@ -683,12 +685,15 @@ static int sg_lock(struct burn_drive *d, int flag)
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
sg_close_drive(d);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (d->lock_fd > 0)
|
||||
close(d->lock_fd);
|
||||
d->lock_fd = flock_fd;
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -762,14 +767,10 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
int done = 0, err, sense_len = 0, ret, ignore_error, no_retry = 0, i;
|
||||
int cam_pass_err_recover = 0, key, asc, ascq, timeout_ms;
|
||||
union ccb *ccb;
|
||||
char buf[161];
|
||||
static FILE *fp = NULL;
|
||||
time_t start_time;
|
||||
|
||||
snprintf(buf, sizeof (buf),
|
||||
"sg_issue_command d->cam=%p d->released=%d",
|
||||
(void*)d->cam, d->released);
|
||||
mmc_function_spy(NULL, buf);
|
||||
mmc_function_spy(NULL, "sg_issue_command");
|
||||
|
||||
if (d->cam == NULL) {
|
||||
c->error = 0;
|
||||
@ -868,7 +869,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
/* ts B00110 */
|
||||
/* Better curb sense_len */
|
||||
sense_len = ccb->csio.sense_len;
|
||||
if (sense_len > sizeof(c->sense))
|
||||
if (sense_len > (int) sizeof(c->sense))
|
||||
sense_len = sizeof(c->sense);
|
||||
memcpy(c->sense, &ccb->csio.sense_data, sense_len);
|
||||
spc_decode_sense(c->sense, sense_len,
|
||||
@ -1055,11 +1056,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
struct statvfs vfsbuf;
|
||||
char testpath[4096], *cpt;
|
||||
char *testpath = NULL, *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
int fd, ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
@ -1072,7 +1074,7 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
|
||||
#ifdef Libburn_if_this_was_linuX
|
||||
|
||||
@ -1083,11 +1085,11 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
open_mode |= O_EXCL;
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* Libburn_if_this_was_linuX */
|
||||
@ -1096,25 +1098,28 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
} else if(S_ISCHR(stbuf.st_mode)) {
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size;
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2009 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -168,6 +168,7 @@ Send feedback to libburn-hackers@pykix.org .
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -429,17 +430,18 @@ int sg_dispose_drive(struct burn_drive *d, int flag)
|
||||
int sg_give_next_adr(burn_drive_enumerator_t *idx,
|
||||
char adr[], int adr_size, int initialize)
|
||||
{
|
||||
int ret, recursion_count = 0;
|
||||
char path[4096];
|
||||
int ret, recursion_count = 0, path_size = 4096;
|
||||
char *path = NULL;
|
||||
#ifdef Libburn_is_on_solariS
|
||||
int l;
|
||||
#endif
|
||||
BURN_ALLOC_MEM(path, char, path_size);
|
||||
|
||||
ret = sg_give_next_adr_raw(idx, adr, adr_size, initialize);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
if (strlen(adr) >= sizeof(path))
|
||||
return ret;
|
||||
goto ex;
|
||||
if (strlen(adr) >= path_size)
|
||||
goto ex;
|
||||
|
||||
#ifdef Libburn_is_on_solariS
|
||||
/* >>> provisory : preserve Solaris /dev/rdsk/cXtYdZs2 addresses */
|
||||
@ -447,13 +449,16 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx,
|
||||
if (l >= 18)
|
||||
if (strncmp(adr, "/dev/rdsk/c", 11) == 0 && adr[11] >= '0' &&
|
||||
adr[11] <= '9' && strcmp(adr + (l - 2), "s2") == 0)
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
#endif /* Libburn_is_on_solariS */
|
||||
|
||||
ret = burn_drive_resolve_link(adr, path, &recursion_count, 2);
|
||||
if(ret > 0 && strlen(path) < adr_size)
|
||||
strcpy(path, adr);
|
||||
return (ret >= 0);
|
||||
ret = (ret >= 0);
|
||||
ex:
|
||||
BURN_FREE_MEM(path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -465,13 +470,17 @@ int scsi_enumerate_drives(void)
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1, ret, i_bus_no = -1, recursion_count = 0;
|
||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||
char buf[4096], target[4096];
|
||||
int buf_size = 4096;
|
||||
char *buf = NULL, *target = NULL;
|
||||
#ifdef Libburn_is_on_solariS
|
||||
int l;
|
||||
#endif
|
||||
|
||||
BURN_ALLOC_MEM(buf, char, buf_size);
|
||||
BURN_ALLOC_MEM(target, char, buf_size);
|
||||
|
||||
while(1) {
|
||||
ret = sg_give_next_adr_raw(&idx, buf, sizeof(buf), initialize);
|
||||
ret = sg_give_next_adr_raw(&idx, buf, buf_size, initialize);
|
||||
initialize = 0;
|
||||
if (ret <= 0)
|
||||
break;
|
||||
@ -501,8 +510,12 @@ int scsi_enumerate_drives(void)
|
||||
i_bus_no, i_host_no, i_channel_no,
|
||||
i_target_no, i_lun_no);
|
||||
}
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return 1;
|
||||
sg_give_next_adr(&idx, buf, buf_size, -1);
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(target);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -526,12 +539,12 @@ int sg_drive_is_open(struct burn_drive * d)
|
||||
int sg_grab(struct burn_drive *d)
|
||||
{
|
||||
CdIo_t *p_cdio;
|
||||
char *am_eff, msg[4096], *am_wanted;
|
||||
int os_errno, second_try = 0;
|
||||
char *am_eff, *msg = NULL, *am_wanted;
|
||||
int os_errno, second_try = 0, ret;
|
||||
|
||||
if (d->p_cdio != NULL) {
|
||||
d->released = 0;
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
if (d->libcdio_name[0] == 0) /* just to be sure it is initialized */
|
||||
strcpy(d->libcdio_name, d->devname);
|
||||
@ -539,13 +552,14 @@ int sg_grab(struct burn_drive *d)
|
||||
try_to_open:;
|
||||
p_cdio = cdio_open_am(d->libcdio_name, DRIVER_DEVICE, am_wanted);
|
||||
if (p_cdio == NULL) {
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
os_errno = errno;
|
||||
sprintf(msg, "Could not grab drive '%s'", d->devname);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
am_eff = (char *) cdio_get_arg(p_cdio, "access-mode");
|
||||
if (strncmp(am_eff, "MMC_RDWR", 8) != 0) {
|
||||
@ -560,12 +574,15 @@ try_to_open:;
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"libcdio provides no MMC_RDWR access mode", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
d->p_cdio = p_cdio;
|
||||
d->released = 0;
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -842,10 +859,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
struct statvfs vfsbuf;
|
||||
#endif
|
||||
|
||||
char testpath[4096], *cpt;
|
||||
char *testpath = NULL, *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
int ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
@ -858,7 +877,7 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
|
||||
#ifdef __linux
|
||||
|
||||
@ -868,11 +887,11 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* __linux */
|
||||
@ -884,11 +903,11 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size;
|
||||
|
||||
#endif /* Libburn_is_on_freebsD */
|
||||
@ -900,12 +919,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = lseek(fd, 0, SEEK_END);
|
||||
close(fd);
|
||||
if (*bytes == -1) {
|
||||
*bytes = 0;
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
#endif /* Libburn_is_on_solariS */
|
||||
@ -914,25 +933,28 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
if (testpath[0]) {
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
#endif /* ! Libburn_os_has_stavtfS */
|
||||
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -237,6 +237,7 @@ static int linux_ata_enumerate_verbous = 0;
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -343,7 +344,7 @@ static void sg_select_device_family(void)
|
||||
static int sg_exchange_scd_for_sr(char *fname, int flag)
|
||||
{
|
||||
struct stat stbuf;
|
||||
char scd[17], msg[160];
|
||||
char scd[17], *msg = NULL;
|
||||
|
||||
if (burn_sg_use_family != 0 || strncmp(fname, "/dev/sr", 7)!=0 ||
|
||||
strlen(fname)>9 || strlen(fname)<8)
|
||||
@ -358,9 +359,14 @@ static int sg_exchange_scd_for_sr(char *fname, int flag)
|
||||
strcpy(scd + 8, fname + 7);
|
||||
if (stat(scd, &stbuf) == -1)
|
||||
return 2;
|
||||
sprintf(msg, "%s substitutes for non-existent %s", scd, fname);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg, 0, 0);
|
||||
msg = calloc(strlen(scd) + strlen(fname) + 80, 1);
|
||||
if (msg != NULL) {
|
||||
sprintf(msg, "%s substitutes for non-existent %s", scd, fname);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
free(msg);
|
||||
}
|
||||
strcpy(fname, scd);
|
||||
return 1;
|
||||
}
|
||||
@ -384,10 +390,12 @@ static int sgio_test(int fd)
|
||||
/* ts A60924 */
|
||||
static int sg_handle_busy_device(char *fname, int os_errno)
|
||||
{
|
||||
char msg[4096];
|
||||
char *msg = NULL;
|
||||
struct stat stbuf;
|
||||
int looks_like_hd= 0, fd, ret;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
|
||||
/* ts A80713 :
|
||||
check existence of /dev/hdX1 as hint for hard disk rather than CD
|
||||
Hint by Giulio Orsero: check /proc/ide/hdX/media for "disk"
|
||||
@ -445,7 +453,10 @@ static int sg_handle_busy_device(char *fname, int os_errno)
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_LOW,
|
||||
msg, os_errno, 0);
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -453,10 +464,11 @@ static int sg_handle_busy_device(char *fname, int os_errno)
|
||||
static int sg_close_drive_fd(char *fname, int driveno, int *fd, int sorry)
|
||||
{
|
||||
int ret, os_errno, sevno= LIBDAX_MSGS_SEV_DEBUG;
|
||||
char msg[4096+100];
|
||||
char *msg = NULL;
|
||||
|
||||
if(*fd < 0)
|
||||
return(0);
|
||||
{ret = 0; goto ex;}
|
||||
BURN_ALLOC_MEM(msg, char, 4096 + 100);
|
||||
|
||||
#ifdef CDROM_MEDIA_CHANGED_disabled_because_not_helpful
|
||||
#ifdef CDSL_CURRENT
|
||||
@ -484,7 +496,7 @@ static int sg_close_drive_fd(char *fname, int driveno, int *fd, int sorry)
|
||||
if(ret != -1) {
|
||||
/* ts A70409 : DDLP-B */
|
||||
/* >>> release single lock on fname */
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
os_errno= errno;
|
||||
|
||||
@ -493,7 +505,10 @@ static int sg_close_drive_fd(char *fname, int driveno, int *fd, int sorry)
|
||||
sevno = LIBDAX_MSGS_SEV_SORRY;
|
||||
libdax_msgs_submit(libdax_messenger, driveno, 0x00020002,
|
||||
sevno, LIBDAX_MSGS_PRIO_HIGH, msg, os_errno, 0);
|
||||
return 0;
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -658,23 +673,28 @@ static int sg_open_scsi_siblings(char *path, int driveno,
|
||||
{
|
||||
int tld, i, ret, fd, i_bus_no = -1;
|
||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||
char msg[161], fname[81];
|
||||
char *msg = NULL, fname[40];
|
||||
struct stat stbuf;
|
||||
dev_t last_rdev = 0, path_rdev;
|
||||
|
||||
static char tldev[][81]= {"/dev/sr%d", "/dev/scd%d", "/dev/sg%d", ""};
|
||||
static char tldev[][20]= {"/dev/sr%d", "/dev/scd%d", "/dev/sg%d", ""};
|
||||
/* ts A70609: removed "/dev/st%d" */
|
||||
|
||||
if (strlen(path) > BURN_MSGS_MESSAGE_LEN - 160)
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, BURN_MSGS_MESSAGE_LEN);
|
||||
|
||||
if(stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
path_rdev = stbuf.st_rdev;
|
||||
|
||||
sg_select_device_family();
|
||||
if (linux_sg_device_family[0] == 0)
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
|
||||
if(host_no < 0 || id_no < 0 || channel_no < 0 || lun_no < 0)
|
||||
return(2);
|
||||
{ret = 2; goto ex;}
|
||||
if(*sibling_count > 0)
|
||||
sg_release_siblings(sibling_fds, sibling_fnames,
|
||||
sibling_count);
|
||||
@ -724,10 +744,14 @@ static int sg_open_scsi_siblings(char *path, int driveno,
|
||||
last_rdev= stbuf.st_rdev;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
failed:;
|
||||
sg_release_siblings(sibling_fds, sibling_fnames, sibling_count);
|
||||
return 0;
|
||||
ret = 0;
|
||||
goto ex;
|
||||
}
|
||||
|
||||
|
||||
@ -782,15 +806,20 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
|
||||
{
|
||||
int fd, sid_ret = 0, ret;
|
||||
struct sg_scsi_id sid;
|
||||
int sibling_fds[BURN_OS_SG_MAX_SIBLINGS], sibling_count= 0;
|
||||
char sibling_fnames[BURN_OS_SG_MAX_SIBLINGS][BURN_OS_SG_MAX_NAMELEN];
|
||||
int *sibling_fds = NULL, sibling_count= 0;
|
||||
typedef char burn_sg_sibling_fname[BURN_OS_SG_MAX_NAMELEN];
|
||||
burn_sg_sibling_fname *sibling_fnames = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(sibling_fds, int, BURN_OS_SG_MAX_SIBLINGS);
|
||||
BURN_ALLOC_MEM(sibling_fnames, burn_sg_sibling_fname,
|
||||
BURN_OS_SG_MAX_SIBLINGS);
|
||||
|
||||
fd = sg_open_drive_fd(fname, 1);
|
||||
if (fd == -1) {
|
||||
if (linux_sg_enumerate_debug)
|
||||
fprintf(stderr, "open failed, errno=%d '%s'\n",
|
||||
errno, strerror(errno));
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
sid_ret = ioctl(fd, SG_GET_SCSI_ID, &sid);
|
||||
@ -808,7 +837,7 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
|
||||
errno, strerror(errno));
|
||||
|
||||
sg_close_drive_fd(fname, -1, &fd, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
#ifdef CDROM_DRIVE_STATUS
|
||||
@ -839,14 +868,14 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
|
||||
fprintf(stderr,
|
||||
"cannot close properly, errno=%d '%s'\n",
|
||||
errno, strerror(errno));
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if ( (sid_ret == -1 || sid.scsi_type != TYPE_ROM)
|
||||
&& !linux_sg_accept_any_type) {
|
||||
if (linux_sg_enumerate_debug)
|
||||
fprintf(stderr, "sid.scsi_type = %d (!= TYPE_ROM)\n",
|
||||
sid.scsi_type);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
if (sid_ret == -1 || sid.scsi_id < 0) {
|
||||
@ -862,7 +891,7 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
|
||||
if (linux_sg_enumerate_debug)
|
||||
fprintf(stderr,
|
||||
"sg_obtain_scsi_adr() failed\n");
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
}
|
||||
|
||||
@ -877,7 +906,7 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
|
||||
if (linux_sg_enumerate_debug)
|
||||
fprintf(stderr, "cannot lock siblings\n");
|
||||
sg_handle_busy_device(fname, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
/* the final occupation will be done in sg_grab() */
|
||||
sg_release_siblings(sibling_fds, sibling_fnames,
|
||||
@ -893,7 +922,11 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
|
||||
*channel_no= sid.channel;
|
||||
*target_no= sid.scsi_id;
|
||||
*lun_no= sid.lun;
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(sibling_fds);
|
||||
BURN_FREE_MEM(sibling_fnames);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1025,33 +1058,35 @@ static int fname_drive_is_listed(char *fname, int flag)
|
||||
*/
|
||||
static int fname_enumerate(char *fname, int flag)
|
||||
{
|
||||
int is_ata= 0, is_scsi= 0;
|
||||
int is_ata= 0, is_scsi= 0, ret;
|
||||
int bus_no= -1, host_no= -1, channel_no= -1, target_no= -1, lun_no= -1;
|
||||
char msg[BURN_DRIVE_ADR_LEN + 80];
|
||||
char *msg = NULL;
|
||||
struct stat stbuf;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, BURN_DRIVE_ADR_LEN + 80);
|
||||
|
||||
if (!(flag & 2))
|
||||
if (fname_drive_is_listed(fname, 0))
|
||||
return 2;
|
||||
{ret = 2; goto ex;}
|
||||
if (stat(fname, &stbuf) == -1) {
|
||||
sprintf(msg, "File object '%s' not found", fname);
|
||||
if (!(flag & 1))
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x0002000b,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
}
|
||||
|
||||
is_ata = is_ata_drive(fname);
|
||||
if (is_ata < 0)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
if (!is_ata)
|
||||
is_scsi = is_scsi_drive(fname, &bus_no, &host_no, &channel_no,
|
||||
&target_no, &lun_no);
|
||||
if (is_scsi < 0)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
if (is_ata == 0 && is_scsi == 0)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
if (linux_sg_enumerate_debug)
|
||||
fprintf(stderr,
|
||||
@ -1059,7 +1094,10 @@ static int fname_enumerate(char *fname, int flag)
|
||||
host_no, channel_no, target_no, lun_no, bus_no);
|
||||
enumerate_common(fname, bus_no, host_no, channel_no,
|
||||
target_no, lun_no);
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1067,22 +1105,25 @@ static int fname_enumerate(char *fname, int flag)
|
||||
static int single_enumerate(int flag)
|
||||
{
|
||||
int ret, wl_count;
|
||||
char *fname, msg[BURN_DRIVE_ADR_LEN + 80];
|
||||
char *fname, *msg = NULL;
|
||||
|
||||
wl_count= burn_drive_whitelist_count();
|
||||
if (wl_count != 1)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
fname= burn_drive_whitelist_item(0, 0);
|
||||
if (fname == NULL)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
ret = fname_enumerate(fname, 2);
|
||||
if (ret <= 0) {
|
||||
BURN_ALLOC_MEM(msg, char, BURN_DRIVE_ADR_LEN + 80);
|
||||
sprintf(msg, "Cannot access '%s' as SG_IO CDROM drive", fname);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x0002000a,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
ret = -1;
|
||||
}
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1094,8 +1135,11 @@ static int single_enumerate(int flag)
|
||||
static int proc_sys_dev_cdrom_info(char ***list, int *count, int flag)
|
||||
{
|
||||
FILE *fp;
|
||||
char line[1024], fname[1024 + 5], *cpt, *retpt, *list_data;
|
||||
int maxl= 0, pass, i;
|
||||
char *line = NULL, *fname = NULL, *cpt, *retpt, *list_data;
|
||||
int maxl= 0, pass, i, line_size = 1024, ret;
|
||||
|
||||
BURN_ALLOC_MEM(line, char, line_size);
|
||||
BURN_ALLOC_MEM(fname, char, line_size + 5);
|
||||
|
||||
if (*list != NULL) {
|
||||
if ((*list)[0] != NULL)
|
||||
@ -1105,17 +1149,17 @@ static int proc_sys_dev_cdrom_info(char ***list, int *count, int flag)
|
||||
*count = 0;
|
||||
}
|
||||
if (flag & 1)
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
|
||||
*count = 0;
|
||||
sg_evaluate_kernel();
|
||||
if (sg_kernel_age < 2) /* addresses are not suitable for kernel 2.4 */
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
fp = fopen("/proc/sys/dev/cdrom/info", "r");
|
||||
if (fp == NULL)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
while (1) {
|
||||
retpt = fgets(line, sizeof(line), fp);
|
||||
retpt = fgets(line, line_size, fp);
|
||||
if (retpt == NULL)
|
||||
break;
|
||||
if(strncmp(line, "drive name:", 11) == 0)
|
||||
@ -1123,7 +1167,7 @@ static int proc_sys_dev_cdrom_info(char ***list, int *count, int flag)
|
||||
}
|
||||
fclose(fp);
|
||||
if (retpt == NULL)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
strcpy(fname, "/dev/");
|
||||
for(pass = 0; pass < 2; pass++) {
|
||||
*count = 0;
|
||||
@ -1133,7 +1177,7 @@ static int proc_sys_dev_cdrom_info(char ***list, int *count, int flag)
|
||||
if (*cpt == 0 || *cpt == '\n')
|
||||
break;
|
||||
sscanf(cpt, "%s", fname + 5);
|
||||
if (strlen(fname) > maxl)
|
||||
if ((int) strlen(fname) > maxl)
|
||||
maxl = strlen(fname);
|
||||
if (pass == 1)
|
||||
strcpy((*list)[*count], fname);
|
||||
@ -1153,13 +1197,17 @@ static int proc_sys_dev_cdrom_info(char ***list, int *count, int flag)
|
||||
free(list_data);
|
||||
if (*list != NULL)
|
||||
free((char *) *list);
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
}
|
||||
for (i = 0; i <= *count; i++)
|
||||
(*list)[i] = list_data + i * (maxl + 1);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(line);
|
||||
BURN_FREE_MEM(fname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1369,7 +1417,7 @@ next_proc_info:;
|
||||
if ((idx->info_list)[i][0] == 0)
|
||||
continue;
|
||||
if (baseno == idx->pos) {
|
||||
if (adr_size < strlen((idx->info_list)[i]) + 1)
|
||||
if (adr_size < (int) strlen((idx->info_list)[i]) + 1)
|
||||
return -1;
|
||||
strcpy(adr, (idx->info_list)[i]);
|
||||
return 1;
|
||||
@ -1576,20 +1624,21 @@ int sg_release(struct burn_drive *d)
|
||||
*/
|
||||
int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
{
|
||||
int done = 0, no_c_page = 0, i;
|
||||
int done = 0, no_c_page = 0, i, ret;
|
||||
int err;
|
||||
time_t start_time;
|
||||
sg_io_hdr_t s;
|
||||
/* ts A61030 */
|
||||
static FILE *fp= NULL;
|
||||
char *msg = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 161);
|
||||
|
||||
/* <<< ts A60821
|
||||
debug: for tracing calls which might use open drive fds */
|
||||
char buf[161];
|
||||
sprintf(buf,"sg_issue_command d->fd= %d d->released= %d\n",
|
||||
d->fd,d->released);
|
||||
mmc_function_spy(NULL, buf);
|
||||
sprintf(msg, "sg_issue_command d->fd= %d d->released= %d\n",
|
||||
d->fd, d->released);
|
||||
mmc_function_spy(NULL, msg);
|
||||
|
||||
/* ts A61030 */
|
||||
if (burn_sg_log_scsi & 1) {
|
||||
@ -1605,7 +1654,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
/* ts A61010 : with no fd there is no chance to send an ioctl */
|
||||
if (d->fd < 0) {
|
||||
c->error = 1;
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
c->error = 0;
|
||||
@ -1657,7 +1706,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
/* a ssert(c->page->bytes > 0); */
|
||||
if (c->page->bytes <= 0) {
|
||||
c->error = 1;
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
s.dxfer_len = c->page->bytes;
|
||||
@ -1684,7 +1733,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
d->released = 1;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
c->error = 1;
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
}
|
||||
done = scsi_eval_cmd_outcome(d, c, fp, s.sbp, s.sb_len_wr,
|
||||
s.duration, start_time, s.timeout, i, 0);
|
||||
@ -1692,8 +1741,6 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
|
||||
if (s.host_status != Libburn_sg_host_oK ||
|
||||
(s.driver_status != Libburn_sg_driver_oK && !c->error)) {
|
||||
char msg[161];
|
||||
|
||||
sprintf(msg,
|
||||
"SCSI command %2.2Xh indicates host or driver error:",
|
||||
(unsigned int) c->opcode[0]);
|
||||
@ -1706,7 +1753,10 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1781,23 +1831,27 @@ int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
||||
*/
|
||||
int sg_is_enumerable_adr(char *adr)
|
||||
{
|
||||
char fname[4096];
|
||||
int ret = 0, first = 1;
|
||||
char *fname = NULL;
|
||||
int ret = 0, first = 1, fname_size = 4096;
|
||||
burn_drive_enumerator_t idx;
|
||||
|
||||
BURN_ALLOC_MEM(fname, char, fname_size);
|
||||
while (1) {
|
||||
ret= sg_give_next_adr(&idx, fname, sizeof(fname), first);
|
||||
ret= sg_give_next_adr(&idx, fname, fname_size, first);
|
||||
if(ret <= 0)
|
||||
break;
|
||||
first = 0;
|
||||
if (strcmp(adr, fname) == 0) {
|
||||
sg_give_next_adr(&idx, fname, sizeof(fname), -1);
|
||||
return 1;
|
||||
sg_give_next_adr(&idx, fname, fname_size, -1);
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
}
|
||||
ret = 0;
|
||||
ex:;
|
||||
if (first == 0)
|
||||
sg_give_next_adr(&idx, fname, sizeof(fname), -1);
|
||||
return(0);
|
||||
sg_give_next_adr(&idx, fname, fname_size, -1);
|
||||
BURN_FREE_MEM(fname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1834,11 +1888,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
struct statvfs vfsbuf;
|
||||
char testpath[4096], *cpt;
|
||||
char *testpath = NULL, *cpt;
|
||||
long blocks;
|
||||
int open_mode = O_RDONLY, fd, ret;
|
||||
off_t add_size = 0;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
@ -1851,29 +1906,32 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2010 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -140,6 +140,7 @@ Send feedback to libburn-hackers@pykix.org .
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -249,12 +250,14 @@ static int start_enum_cXtYdZs2(burn_drive_enumerator_t *idx, int flag)
|
||||
static int next_enum_cXtYdZs2(burn_drive_enumerator_t *idx,
|
||||
char adr[], int adr_size, int flag)
|
||||
{
|
||||
int busno, tgtno, lunno, ret, fd = -1;
|
||||
char volpath[160];
|
||||
int busno, tgtno, lunno, ret, fd = -1, volpath_size = 160;
|
||||
char *volpath = NULL;
|
||||
struct dirent *entry;
|
||||
struct dk_cinfo cinfo;
|
||||
DIR *dir;
|
||||
|
||||
BURN_ALLOC_MEM(volpath, char, volpath_size);
|
||||
|
||||
dir = idx->dir;
|
||||
while (1) {
|
||||
errno = 0;
|
||||
@ -266,11 +269,11 @@ static int next_enum_cXtYdZs2(burn_drive_enumerator_t *idx,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Cannot enumerate next device. readdir() from \"/dev/rdsk\" failed.",
|
||||
errno, 0);
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (strlen(entry->d_name) > sizeof(volpath) - 11)
|
||||
if (strlen(entry->d_name) > (size_t) (volpath_size - 11))
|
||||
continue;
|
||||
ret = decode_btl_solaris(entry->d_name,
|
||||
&busno, &tgtno, &lunno, 0);
|
||||
@ -291,12 +294,15 @@ static int next_enum_cXtYdZs2(burn_drive_enumerator_t *idx,
|
||||
continue;
|
||||
if (cinfo.dki_ctype != DKC_CDROM)
|
||||
continue;
|
||||
if (adr_size <= strlen(volpath))
|
||||
return -1;
|
||||
if (adr_size <= (int) strlen(volpath))
|
||||
{ret = -1; goto ex;}
|
||||
strcpy(adr, volpath);
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
return 0;
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(volpath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -457,12 +463,14 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx,
|
||||
int scsi_enumerate_drives(void)
|
||||
{
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1, ret, i_bus_no = -1;
|
||||
int initialize = 1, ret, i_bus_no = -1, buf_size = 4096;
|
||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||
char buf[4096];
|
||||
char *buf = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(buf, char, buf_size);
|
||||
|
||||
while(1) {
|
||||
ret = sg_give_next_adr(&idx, buf, sizeof(buf), initialize);
|
||||
ret = sg_give_next_adr(&idx, buf, buf_size, initialize);
|
||||
initialize = 0;
|
||||
if (ret <= 0)
|
||||
break;
|
||||
@ -474,8 +482,11 @@ int scsi_enumerate_drives(void)
|
||||
i_bus_no, i_host_no, i_channel_no,
|
||||
i_target_no, i_lun_no);
|
||||
}
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return 1;
|
||||
sg_give_next_adr(&idx, buf, buf_size, -1);
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -498,13 +509,15 @@ int sg_drive_is_open(struct burn_drive * d)
|
||||
*/
|
||||
int sg_grab(struct burn_drive *d)
|
||||
{
|
||||
char msg[4096];
|
||||
char *msg = NULL;
|
||||
int os_errno, ret;
|
||||
struct dk_cinfo cinfo;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
|
||||
if (d->fd != -1) {
|
||||
d->released = 0;
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
d->fd = open(d->devname, O_RDONLY | O_NDELAY);
|
||||
if (d->fd == -1) {
|
||||
@ -514,7 +527,7 @@ int sg_grab(struct burn_drive *d)
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
ret = ioctl(d->fd, DKIOCINFO, &cinfo);
|
||||
if (ret < 0)
|
||||
@ -525,7 +538,7 @@ int sg_grab(struct burn_drive *d)
|
||||
/* >>> obtain eventual locks */;
|
||||
|
||||
d->released = 0;
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
revoke:;
|
||||
sprintf(msg, "Could not grab drive '%s'. Not a CDROM device.",
|
||||
d->devname);
|
||||
@ -533,7 +546,10 @@ revoke:;
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -762,15 +778,18 @@ int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
int ret;
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
struct statvfs vfsbuf;
|
||||
#endif
|
||||
|
||||
char testpath[4096], *cpt;
|
||||
char *testpath = NULL, *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
@ -783,44 +802,47 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
int open_mode = O_RDONLY, fd;
|
||||
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = lseek(fd, 0, SEEK_END);
|
||||
close(fd);
|
||||
if (*bytes == -1) {
|
||||
*bytes = 0;
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
if (testpath[0]) {
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
#endif /* ! Libburn_os_has_stavtfS */
|
||||
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
500
libburn/spc.c
500
libburn/spc.c
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#include "drive.h"
|
||||
#include "debug.h"
|
||||
#include "options.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -63,6 +64,7 @@ int scsi_init_command(struct command *c, unsigned char *opcode, int oplen)
|
||||
{
|
||||
if (oplen > 16)
|
||||
return 0;
|
||||
memset(c, 0, sizeof(struct command));
|
||||
memcpy(c->opcode, opcode, oplen);
|
||||
c->oplen = oplen;
|
||||
c->dir = NO_TRANSFER;
|
||||
@ -101,23 +103,18 @@ int spc_decode_sense(unsigned char *sense, int senselen,
|
||||
|
||||
int spc_test_unit_ready_r(struct burn_drive *d, int *key, int *asc, int *ascq)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "test_unit_ready") <= 0)
|
||||
return 0;
|
||||
|
||||
scsi_init_command(&c, SPC_TEST_UNIT_READY,sizeof(SPC_TEST_UNIT_READY));
|
||||
c.retry = 0;
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
if (c.error) {
|
||||
|
||||
/*
|
||||
fprintf(stderr, "sense[0 - 2] = %2.2X %2.2X %2.2X",
|
||||
c.sense[0], c.sense[1], c.sense[2]);
|
||||
*/
|
||||
|
||||
spc_decode_sense(c.sense, 0, key, asc, ascq);
|
||||
scsi_init_command(c, SPC_TEST_UNIT_READY,sizeof(SPC_TEST_UNIT_READY));
|
||||
c->retry = 0;
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
if (c->error) {
|
||||
spc_decode_sense(c->sense, 0, key, asc, ascq);
|
||||
return (key == 0);
|
||||
}
|
||||
return 1;
|
||||
@ -142,10 +139,11 @@ int spc_wait_unit_attention(struct burn_drive *d, int max_sec, char *cmd_text,
|
||||
{
|
||||
int i, ret = 1, key = 0, asc = 0, ascq = 0, clueless_start = 0;
|
||||
static int clueless_timeout = 5 * 10;
|
||||
char msg[320];
|
||||
char *msg = NULL;
|
||||
unsigned char sense[14];
|
||||
enum response resp;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 320);
|
||||
if (!(flag & 1))
|
||||
usleep(100000);
|
||||
for(i = !(flag & 1); i < max_sec * 10; i++) {
|
||||
@ -217,97 +215,105 @@ slumber:;
|
||||
}
|
||||
|
||||
if (i < max_sec * 10)
|
||||
return (ret > 0);
|
||||
{ret = (ret > 0); goto ex;}
|
||||
|
||||
sprintf(msg, "Timeout (%d s) with asynchronous SCSI command %s\n",
|
||||
max_sec, cmd_text);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002014f,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, msg, 0, 0);
|
||||
return 0;
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void spc_request_sense(struct burn_drive *d, struct buffer *buf)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "request_sense") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(&c, SPC_REQUEST_SENSE, sizeof(SPC_REQUEST_SENSE));
|
||||
c.retry = 0;
|
||||
/*
|
||||
c.oplen = sizeof(SPC_REQUEST_SENSE);
|
||||
memcpy(c.opcode, SPC_REQUEST_SENSE, sizeof(SPC_REQUEST_SENSE));
|
||||
*/
|
||||
c.dxfer_len= c.opcode[4];
|
||||
c.retry = 0;
|
||||
c.page = buf;
|
||||
c.page->sectors = 0;
|
||||
c.page->bytes = 0;
|
||||
c.dir = FROM_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
scsi_init_command(c, SPC_REQUEST_SENSE, sizeof(SPC_REQUEST_SENSE));
|
||||
c->retry = 0;
|
||||
c->dxfer_len= c->opcode[4];
|
||||
c->retry = 0;
|
||||
c->page = buf;
|
||||
c->page->sectors = 0;
|
||||
c->page->bytes = 0;
|
||||
c->dir = FROM_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
}
|
||||
|
||||
int spc_get_erase_progress(struct burn_drive *d)
|
||||
{
|
||||
struct buffer b;
|
||||
struct buffer *b = NULL;
|
||||
int ret;
|
||||
|
||||
if (mmc_function_spy(d, "get_erase_progress") <= 0)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
spc_request_sense(d, &b);
|
||||
return (b.data[16] << 8) | b.data[17];
|
||||
BURN_ALLOC_MEM(b, struct buffer, 1);
|
||||
spc_request_sense(d, b);
|
||||
ret = (b->data[16] << 8) | b->data[17];
|
||||
ex:;
|
||||
BURN_FREE_MEM(b);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void spc_inquiry(struct burn_drive *d)
|
||||
{
|
||||
struct buffer buf;
|
||||
struct buffer *buf = NULL;
|
||||
struct burn_scsi_inquiry_data *id;
|
||||
struct command c;
|
||||
struct command *c = NULL;
|
||||
int ret;
|
||||
|
||||
if (mmc_function_spy(d, "inquiry") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(&c, SPC_INQUIRY, sizeof(SPC_INQUIRY));
|
||||
/*
|
||||
memcpy(c.opcode, SPC_INQUIRY, sizeof(SPC_INQUIRY));
|
||||
c.oplen = sizeof(SPC_INQUIRY);
|
||||
*/
|
||||
c.dxfer_len = (c.opcode[3] << 8) | c.opcode[4];
|
||||
c.retry = 1;
|
||||
c.page = &buf;
|
||||
c.page->bytes = 0;
|
||||
c.page->sectors = 0;
|
||||
c.dir = FROM_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
scsi_init_command(c, SPC_INQUIRY, sizeof(SPC_INQUIRY));
|
||||
c->dxfer_len = (c->opcode[3] << 8) | c->opcode[4];
|
||||
c->retry = 1;
|
||||
c->page = buf;
|
||||
c->page->bytes = 0;
|
||||
c->page->sectors = 0;
|
||||
c->dir = FROM_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
id = (struct burn_scsi_inquiry_data *)d->idata;
|
||||
memset(id->vendor, 0, 9);
|
||||
memset(id->product, 0, 17);
|
||||
memset(id->revision, 0, 5);
|
||||
if (c.error) {
|
||||
if (c->error) {
|
||||
id->valid = -1;
|
||||
return;
|
||||
goto ex;
|
||||
}
|
||||
memcpy(id->vendor, c.page->data + 8, 8);
|
||||
memcpy(id->product, c.page->data + 16, 16);
|
||||
memcpy(id->revision, c.page->data + 32, 4);
|
||||
memcpy(id->vendor, c->page->data + 8, 8);
|
||||
memcpy(id->product, c->page->data + 16, 16);
|
||||
memcpy(id->revision, c->page->data + 32, 4);
|
||||
id->valid = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(c);
|
||||
return;
|
||||
}
|
||||
|
||||
void spc_prevent(struct burn_drive *d)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "prevent") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(&c, SPC_PREVENT, sizeof(SPC_PREVENT));
|
||||
c.retry = 1;
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
|
||||
scsi_init_command(c, SPC_PREVENT, sizeof(SPC_PREVENT));
|
||||
c->retry = 1;
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
|
||||
#ifdef Libburn_pioneer_dvr_216d_get_evenT
|
||||
mmc_get_event(d);
|
||||
#endif
|
||||
@ -316,20 +322,16 @@ void spc_prevent(struct burn_drive *d)
|
||||
|
||||
void spc_allow(struct burn_drive *d)
|
||||
{
|
||||
struct command c;
|
||||
struct command *c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "allow") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(&c, SPC_ALLOW, sizeof(SPC_ALLOW));
|
||||
/*
|
||||
memcpy(c.opcode, SPC_ALLOW, sizeof(SPC_ALLOW));
|
||||
c.oplen = sizeof(SPC_ALLOW);
|
||||
c.page = NULL;
|
||||
*/
|
||||
c.retry = 1;
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
scsi_init_command(c, SPC_ALLOW, sizeof(SPC_ALLOW));
|
||||
c->retry = 1;
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -338,50 +340,54 @@ ts A70518 - A90603 : Do not call with *alloc_len < 10
|
||||
/** flag&1= do only inquire alloc_len */
|
||||
static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
|
||||
{
|
||||
struct buffer buf;
|
||||
struct buffer *buf = NULL;
|
||||
struct scsi_mode_data *m;
|
||||
int size, page_length, num_write_speeds = 0, i, speed, ret;
|
||||
int old_alloc_len, was_error = 0;
|
||||
unsigned char *page;
|
||||
struct command c;
|
||||
struct command *c = NULL;
|
||||
struct burn_speed_descriptor *sd;
|
||||
char msg[BURN_DRIVE_ADR_LEN + 160];
|
||||
char *msg = NULL;
|
||||
|
||||
/* ts A61225 : 1 = report about post-MMC-1 speed descriptors */
|
||||
static int speed_debug = 0;
|
||||
|
||||
if (*alloc_len < 10)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, BURN_DRIVE_ADR_LEN + 160);
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
|
||||
/* ts A90602 : Clearing mdata before command execution */
|
||||
m = d->mdata;
|
||||
m->valid = 0;
|
||||
burn_mdata_free_subs(m);
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
scsi_init_command(&c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
memset(buf, 0, sizeof(struct buffer));
|
||||
scsi_init_command(c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
/*
|
||||
memcpy(c.opcode, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c.oplen = sizeof(SPC_MODE_SENSE);
|
||||
memcpy(c->opcode, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c->oplen = sizeof(SPC_MODE_SENSE);
|
||||
*/
|
||||
c.dxfer_len = *alloc_len;
|
||||
c.opcode[7] = (c.dxfer_len >> 8) & 0xff;
|
||||
c.opcode[8] = c.dxfer_len & 0xff;
|
||||
c.retry = 1;
|
||||
c.opcode[2] = 0x2A;
|
||||
c.page = &buf;
|
||||
c.page->bytes = 0;
|
||||
c.page->sectors = 0;
|
||||
c.dir = FROM_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
if (c.error) {
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
c->dxfer_len = *alloc_len;
|
||||
c->opcode[7] = (c->dxfer_len >> 8) & 0xff;
|
||||
c->opcode[8] = c->dxfer_len & 0xff;
|
||||
c->retry = 1;
|
||||
c->opcode[2] = 0x2A;
|
||||
c->page = buf;
|
||||
c->page->bytes = 0;
|
||||
c->page->sectors = 0;
|
||||
c->dir = FROM_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
if (c->error) {
|
||||
memset(buf, 0, sizeof(struct buffer));
|
||||
m->valid = -1;
|
||||
was_error = 1;
|
||||
}
|
||||
|
||||
size = c.page->data[0] * 256 + c.page->data[1] + 2;
|
||||
page = c.page->data + 8;
|
||||
size = c->page->data[0] * 256 + c->page->data[1] + 2;
|
||||
page = c->page->data + 8;
|
||||
|
||||
/* ts A61225 :
|
||||
Although MODE SENSE indeed belongs to SPC, the returned code page
|
||||
@ -397,7 +403,7 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
|
||||
old_alloc_len = *alloc_len;
|
||||
*alloc_len = page_length + 10;
|
||||
if (flag & 1)
|
||||
return !was_error;
|
||||
{ret = !was_error; goto ex;}
|
||||
if (page_length + 10 > old_alloc_len)
|
||||
page_length = old_alloc_len - 10;
|
||||
|
||||
@ -409,7 +415,7 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x0002016e, LIBDAX_MSGS_SEV_DEBUG,
|
||||
LIBDAX_MSGS_PRIO_LOW, msg, 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
m->buffer_size = page[12] * 256 + page[13];
|
||||
@ -460,14 +466,12 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
|
||||
m->max_write_speed = m->min_write_speed = m->cur_write_speed;
|
||||
|
||||
if (32 + 4 * num_write_speeds > page_length + 2) {
|
||||
char msg[161];
|
||||
|
||||
sprintf(msg, "Malformed capabilities page 2Ah received (len=%d, #speeds=%d)", page_length, num_write_speeds);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x0002013c,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
for (i = 0; i < num_write_speeds; i++) {
|
||||
@ -523,7 +527,12 @@ try_mmc_get_performance:;
|
||||
m->min_write_speed, m->max_write_speed);
|
||||
}
|
||||
|
||||
return !was_error;
|
||||
ret = !was_error;
|
||||
ex:
|
||||
BURN_FREE_MEM(msg);
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(c);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -550,117 +559,119 @@ void spc_sense_caps(struct burn_drive *d)
|
||||
|
||||
void spc_sense_error_params(struct burn_drive *d)
|
||||
{
|
||||
struct buffer buf;
|
||||
struct buffer *buf = NULL;
|
||||
struct scsi_mode_data *m;
|
||||
int size, alloc_len = 12 ;
|
||||
unsigned char *page;
|
||||
struct command c;
|
||||
struct command *c = NULL;
|
||||
int ret;
|
||||
|
||||
mmc_start_if_needed(d, 1);
|
||||
if (mmc_function_spy(d, "sense_error_params") <= 0)
|
||||
return;
|
||||
goto ex;
|
||||
|
||||
scsi_init_command(&c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
/*
|
||||
memcpy(c.opcode, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c.oplen = sizeof(SPC_MODE_SENSE);
|
||||
*/
|
||||
c.dxfer_len = alloc_len;
|
||||
c.opcode[7] = (c.dxfer_len >> 8) & 0xff;
|
||||
c.opcode[8] = c.dxfer_len & 0xff;
|
||||
c.retry = 1;
|
||||
c.opcode[2] = 0x01;
|
||||
c.page = &buf;
|
||||
c.page->bytes = 0;
|
||||
c.page->sectors = 0;
|
||||
c.dir = FROM_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
|
||||
size = c.page->data[0] * 256 + c.page->data[1] + 2;
|
||||
scsi_init_command(c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c->dxfer_len = alloc_len;
|
||||
c->opcode[7] = (c->dxfer_len >> 8) & 0xff;
|
||||
c->opcode[8] = c->dxfer_len & 0xff;
|
||||
c->retry = 1;
|
||||
c->opcode[2] = 0x01;
|
||||
c->page = buf;
|
||||
c->page->bytes = 0;
|
||||
c->page->sectors = 0;
|
||||
c->dir = FROM_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
|
||||
size = c->page->data[0] * 256 + c->page->data[1] + 2;
|
||||
m = d->mdata;
|
||||
page = c.page->data + 8;
|
||||
page = c->page->data + 8;
|
||||
d->params.retries = page[3];
|
||||
m->retry_page_length = page[1];
|
||||
m->retry_page_valid = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(c);
|
||||
}
|
||||
|
||||
void spc_select_error_params(struct burn_drive *d,
|
||||
const struct burn_read_opts *o)
|
||||
{
|
||||
struct buffer buf;
|
||||
struct command c;
|
||||
struct buffer *buf = NULL;
|
||||
struct command *c = NULL;
|
||||
int ret;
|
||||
|
||||
mmc_start_if_needed(d, 1);
|
||||
if (mmc_function_spy(d, "select_error_params") <= 0)
|
||||
return;
|
||||
goto ex;
|
||||
|
||||
scsi_init_command(&c, SPC_MODE_SELECT, sizeof(SPC_MODE_SELECT));
|
||||
/*
|
||||
memcpy(c.opcode, SPC_MODE_SELECT, sizeof(SPC_MODE_SELECT));
|
||||
c.oplen = sizeof(SPC_MODE_SELECT);
|
||||
*/
|
||||
c.retry = 1;
|
||||
c.opcode[8] = 8 + 2 + d->mdata->retry_page_length;
|
||||
c.page = &buf;
|
||||
c.page->bytes = 0;
|
||||
c.page->sectors = 0;
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
|
||||
scsi_init_command(c, SPC_MODE_SELECT, sizeof(SPC_MODE_SELECT));
|
||||
c->retry = 1;
|
||||
c->opcode[8] = 8 + 2 + d->mdata->retry_page_length;
|
||||
c->page = buf;
|
||||
c->page->bytes = 0;
|
||||
c->page->sectors = 0;
|
||||
|
||||
/* ts A61007 : moved up to only caller burn_disc_read() */
|
||||
/* a ssert(d->mdata->valid); */
|
||||
|
||||
memset(c.page->data, 0, 8 + 2 + d->mdata->retry_page_length);
|
||||
c.page->bytes = 8 + 2 + d->mdata->retry_page_length;
|
||||
c.page->data[8] = 1;
|
||||
c.page->data[9] = d->mdata->retry_page_length;
|
||||
memset(c->page->data, 0, 8 + 2 + d->mdata->retry_page_length);
|
||||
c->page->bytes = 8 + 2 + d->mdata->retry_page_length;
|
||||
c->page->data[8] = 1;
|
||||
c->page->data[9] = d->mdata->retry_page_length;
|
||||
if (o->transfer_damaged_blocks)
|
||||
c.page->data[10] |= 32;
|
||||
c->page->data[10] |= 32;
|
||||
if (o->report_recovered_errors)
|
||||
c.page->data[10] |= 4;
|
||||
c->page->data[10] |= 4;
|
||||
if (!o->hardware_error_recovery)
|
||||
c.page->data[10] |= 1;
|
||||
c->page->data[10] |= 1;
|
||||
/*burn_print(1, "error parameter 0x%x\n", c->page->data[10]);*/
|
||||
c.page->data[11] = d->params.retries;
|
||||
c.dir = TO_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
c->page->data[11] = d->params.retries;
|
||||
c->dir = TO_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(c);
|
||||
}
|
||||
|
||||
void spc_sense_write_params(struct burn_drive *d)
|
||||
{
|
||||
struct buffer buf;
|
||||
struct buffer *buf = NULL;
|
||||
struct scsi_mode_data *m;
|
||||
int size, dummy, alloc_len = 10;
|
||||
int size, dummy, alloc_len = 10, ret;
|
||||
unsigned char *page;
|
||||
struct command c;
|
||||
struct command *c = NULL;
|
||||
|
||||
mmc_start_if_needed(d, 1);
|
||||
if (mmc_function_spy(d, "sense_write_params") <= 0)
|
||||
return;
|
||||
goto ex;
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
|
||||
/* ts A61007 : Done in soft at only caller burn_drive_grab() */
|
||||
/* a ssert(d->mdata->cdr_write || d->mdata->cdrw_write ||
|
||||
d->mdata->dvdr_write || d->mdata->dvdram_write); */
|
||||
|
||||
scsi_init_command(&c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
/*
|
||||
memcpy(c.opcode, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c.oplen = sizeof(SPC_MODE_SENSE);
|
||||
*/
|
||||
c.dxfer_len = alloc_len;
|
||||
c.opcode[7] = (c.dxfer_len >> 8) & 0xff;
|
||||
c.opcode[8] = c.dxfer_len & 0xff;
|
||||
c.retry = 1;
|
||||
c.opcode[2] = 0x05;
|
||||
c.page = &buf;
|
||||
c.page->bytes = 0;
|
||||
c.page->sectors = 0;
|
||||
c.dir = FROM_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
scsi_init_command(c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c->dxfer_len = alloc_len;
|
||||
c->opcode[7] = (c->dxfer_len >> 8) & 0xff;
|
||||
c->opcode[8] = c->dxfer_len & 0xff;
|
||||
c->retry = 1;
|
||||
c->opcode[2] = 0x05;
|
||||
c->page = buf;
|
||||
c->page->bytes = 0;
|
||||
c->page->sectors = 0;
|
||||
c->dir = FROM_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
|
||||
/* ts A71128 : do not interpret reply if error */
|
||||
m = d->mdata;
|
||||
if (!c.error) {
|
||||
size = c.page->data[0] * 256 + c.page->data[1] + 2;
|
||||
page = c.page->data + 8;
|
||||
if (!c->error) {
|
||||
size = c->page->data[0] * 256 + c->page->data[1] + 2;
|
||||
page = c->page->data + 8;
|
||||
burn_print(1, "write page length 0x%x\n", page[1]);
|
||||
m->write_page_length = page[1];
|
||||
m->write_page_valid = 1;
|
||||
@ -683,6 +694,9 @@ void spc_sense_write_params(struct burn_drive *d)
|
||||
(double) d->media_capacity_remaining);
|
||||
*/
|
||||
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(c);
|
||||
}
|
||||
|
||||
|
||||
@ -694,13 +708,16 @@ Thus the filling of the mode page is done by mmc_compose_mode_page_5().
|
||||
void spc_select_write_params(struct burn_drive *d,
|
||||
const struct burn_write_opts *o)
|
||||
{
|
||||
struct buffer buf;
|
||||
struct command c;
|
||||
int alloc_len;
|
||||
struct buffer *buf = NULL;
|
||||
struct command *c = NULL;
|
||||
int alloc_len, ret;
|
||||
|
||||
mmc_start_if_needed(d, 1);
|
||||
if (mmc_function_spy(d, "select_write_params") <= 0)
|
||||
return;
|
||||
goto ex;
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
|
||||
/* ts A61007 : All current callers are safe. */
|
||||
/* a ssert(o->drive == d); */
|
||||
@ -713,50 +730,50 @@ void spc_select_write_params(struct burn_drive *d,
|
||||
*/
|
||||
|
||||
alloc_len = 8 + 2 + d->mdata->write_page_length;
|
||||
memset(&(buf.data), 0, alloc_len);
|
||||
memset(&(buf->data), 0, alloc_len);
|
||||
|
||||
#ifdef Libburn_pioneer_dvr_216d_load_mode5
|
||||
|
||||
scsi_init_command(&c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c.dxfer_len = alloc_len;
|
||||
c.opcode[7] = (alloc_len >> 8) & 0xff;
|
||||
c.opcode[8] = alloc_len & 0xff;
|
||||
c.retry = 1;
|
||||
c.opcode[2] = 0x05;
|
||||
c.page = &buf;
|
||||
c.page->bytes = 0;
|
||||
c.page->sectors = 0;
|
||||
c.dir = FROM_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
scsi_init_command(c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
|
||||
c->dxfer_len = alloc_len;
|
||||
c->opcode[7] = (alloc_len >> 8) & 0xff;
|
||||
c->opcode[8] = alloc_len & 0xff;
|
||||
c->retry = 1;
|
||||
c->opcode[2] = 0x05;
|
||||
c->page = buf;
|
||||
c->page->bytes = 0;
|
||||
c->page->sectors = 0;
|
||||
c->dir = FROM_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
|
||||
if (c.error)
|
||||
memset(&(buf.data), 0,
|
||||
if (c->error)
|
||||
memset(&(buf->data), 0,
|
||||
8 + 2 + d->mdata->write_page_length);
|
||||
|
||||
#endif /* Libburn_pioneer_dvr_216d_load_mode5 */
|
||||
|
||||
scsi_init_command(&c, SPC_MODE_SELECT, sizeof(SPC_MODE_SELECT));
|
||||
c.retry = 1;
|
||||
c.opcode[7] = (alloc_len >> 8) & 0xff;
|
||||
c.opcode[8] = alloc_len & 0xff;
|
||||
c.page = &buf;
|
||||
c.page->bytes = 0;
|
||||
c.page->sectors = 0;
|
||||
scsi_init_command(c, SPC_MODE_SELECT, sizeof(SPC_MODE_SELECT));
|
||||
c->retry = 1;
|
||||
c->opcode[7] = (alloc_len >> 8) & 0xff;
|
||||
c->opcode[8] = alloc_len & 0xff;
|
||||
c->page = buf;
|
||||
c->page->bytes = 0;
|
||||
c->page->sectors = 0;
|
||||
|
||||
/* ts A61007 : moved up to burn_disc_write() */
|
||||
/* a ssert(d->mdata->valid); */
|
||||
|
||||
c.page->bytes = alloc_len;
|
||||
c->page->bytes = alloc_len;
|
||||
|
||||
burn_print(12, "using write page length %d (valid %d)\n",
|
||||
d->mdata->write_page_length, d->mdata->write_page_valid);
|
||||
|
||||
/* ts A61229 */
|
||||
if (mmc_compose_mode_page_5(d, o, c.page->data + 8) <= 0)
|
||||
return;
|
||||
if (mmc_compose_mode_page_5(d, o, c->page->data + 8) <= 0)
|
||||
goto ex;
|
||||
|
||||
c.dir = TO_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
c->dir = TO_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(c);
|
||||
}
|
||||
|
||||
void spc_getcaps(struct burn_drive *d)
|
||||
@ -776,16 +793,19 @@ some drives say they're ok, and they're not.
|
||||
|
||||
void spc_probe_write_modes(struct burn_drive *d)
|
||||
{
|
||||
struct buffer buf;
|
||||
struct buffer *buf = NULL;
|
||||
int try_write_type = 1;
|
||||
int try_block_type = 0;
|
||||
int key, asc, ascq, useable_write_type = -1, useable_block_type = -1;
|
||||
int last_try = 0;
|
||||
struct command c;
|
||||
int last_try = 0, ret;
|
||||
struct command *c = NULL;
|
||||
|
||||
mmc_start_if_needed(d, 1);
|
||||
if (mmc_function_spy(d, "spc_probe_write_modes") <= 0)
|
||||
return;
|
||||
goto ex;
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
|
||||
/* ts A70213 : added pseudo try_write_type 4 to set a suitable mode */
|
||||
while (try_write_type != 5) {
|
||||
@ -802,33 +822,33 @@ void spc_probe_write_modes(struct burn_drive *d)
|
||||
last_try= 1;
|
||||
}
|
||||
|
||||
scsi_init_command(&c, SPC_MODE_SELECT,sizeof(SPC_MODE_SELECT));
|
||||
c.retry = 1;
|
||||
c.opcode[8] = 8 + 2 + 0x32;
|
||||
c.page = &buf;
|
||||
scsi_init_command(c, SPC_MODE_SELECT,sizeof(SPC_MODE_SELECT));
|
||||
c->retry = 1;
|
||||
c->opcode[8] = 8 + 2 + 0x32;
|
||||
c->page = buf;
|
||||
|
||||
memset(c.page->data, 0, 8 + 2 + 0x32);
|
||||
c.page->bytes = 8 + 2 + 0x32;
|
||||
memset(c->page->data, 0, 8 + 2 + 0x32);
|
||||
c->page->bytes = 8 + 2 + 0x32;
|
||||
|
||||
c.page->data[8] = 5;
|
||||
c.page->data[9] = 0x32;
|
||||
c.page->data[10] = try_write_type;
|
||||
c->page->data[8] = 5;
|
||||
c->page->data[9] = 0x32;
|
||||
c->page->data[10] = try_write_type;
|
||||
if (try_block_type > 4)
|
||||
c.page->data[11] = 4;
|
||||
c->page->data[11] = 4;
|
||||
else
|
||||
c.page->data[11] = 0;
|
||||
c.page->data[12] = try_block_type;
|
||||
c.page->data[23] = 150;
|
||||
c.dir = TO_DRIVE;
|
||||
c->page->data[11] = 0;
|
||||
c->page->data[12] = try_block_type;
|
||||
c->page->data[23] = 150;
|
||||
c->dir = TO_DRIVE;
|
||||
|
||||
d->silent_on_scsi_error = 1;
|
||||
d->issue_command(d, &c);
|
||||
d->issue_command(d, c);
|
||||
d->silent_on_scsi_error = 0;
|
||||
|
||||
if (last_try)
|
||||
break;
|
||||
|
||||
spc_decode_sense(c.sense, 0, &key, &asc, &ascq);
|
||||
spc_decode_sense(c->sense, 0, &key, &asc, &ascq);
|
||||
if (key)
|
||||
burn_print(7, "%d not supported\n", try_block_type);
|
||||
else {
|
||||
@ -871,10 +891,12 @@ void spc_probe_write_modes(struct burn_drive *d)
|
||||
try_write_type++;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
goto ex;
|
||||
}
|
||||
}
|
||||
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(c);
|
||||
}
|
||||
|
||||
/* ( ts A61229 : shouldn't this go to mmc.c too ?) */
|
||||
@ -1232,6 +1254,10 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
|
||||
else if (*ascq == 2)
|
||||
sprintf(msg, "Timeout on logical unit");
|
||||
return FAIL;
|
||||
case 0x44:
|
||||
if (*ascq == 0)
|
||||
sprintf(msg, "Internal target failure");
|
||||
return FAIL;
|
||||
case 0x57:
|
||||
if (*key != 3 || *ascq != 0)
|
||||
break;
|
||||
@ -1300,15 +1326,20 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
|
||||
enum response scsi_error(struct burn_drive *d, unsigned char *sense,
|
||||
int senselen)
|
||||
{
|
||||
int key, asc, ascq;
|
||||
char msg[160];
|
||||
int key, asc, ascq, ret = 0;
|
||||
char *msg = NULL;
|
||||
enum response resp;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
resp = scsi_error_msg(d, sense, senselen, msg, &key, &asc, &ascq);
|
||||
if (asc == 0 || asc == 0x3A)
|
||||
burn_print(12, "%s\n", msg);
|
||||
else
|
||||
burn_print(1, "%s\n", msg);
|
||||
ex:;
|
||||
if (ret == -1)
|
||||
resp = FAIL;
|
||||
BURN_FREE_MEM(msg);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@ -1382,27 +1413,33 @@ static char *scsi_command_name(unsigned int c, int flag)
|
||||
|
||||
|
||||
/* ts A61030 - A61115 */
|
||||
/* @param flag bit0=do report conditions which are considered not an error */
|
||||
/* @param flag bit0= do report conditions which are considered not an error
|
||||
bit1= report with severity FAILURE rather than DEBUG
|
||||
*/
|
||||
int scsi_notify_error(struct burn_drive *d, struct command *c,
|
||||
unsigned char *sense, int senselen, int flag)
|
||||
{
|
||||
int key= -1, asc= -1, ascq= -1, ret;
|
||||
char msg[320],scsi_msg[160];
|
||||
char *msg = NULL, *scsi_msg = NULL;
|
||||
|
||||
if (d->silent_on_scsi_error)
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 320);
|
||||
BURN_ALLOC_MEM(scsi_msg, char, 160);
|
||||
scsi_error_msg(d, sense, senselen, scsi_msg, &key, &asc, &ascq);
|
||||
|
||||
if (!(flag & 1)) {
|
||||
/* SPC : TEST UNIT READY command */
|
||||
if (c->opcode[0] == 0)
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
/* MMC : READ DISC INFORMATION command */
|
||||
if (c->opcode[0] == 0x51)
|
||||
if (key == 0x2 && asc == 0x3A &&
|
||||
ascq>=0 && ascq <= 0x02) /* MEDIUM NOT PRESENT */
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
if (key == 0 && asc == 0 && ascq == 0)
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
|
||||
sprintf(msg, "SCSI error condition on command %2.2Xh %s: ",
|
||||
@ -1410,8 +1447,11 @@ int scsi_notify_error(struct burn_drive *d, struct command *c,
|
||||
scsi_command_name((unsigned int) c->opcode[0], 0));
|
||||
strcat(msg, scsi_msg);
|
||||
ret = libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002010f,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
|
||||
|
||||
flag & 2 ? LIBDAX_MSGS_SEV_FAILURE : LIBDAX_MSGS_SEV_DEBUG,
|
||||
LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
BURN_FREE_MEM(scsi_msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#include "structure.h"
|
||||
#include "write.h"
|
||||
#include "debug.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -33,7 +34,7 @@ extern struct libdax_msgs *libdax_messenger;
|
||||
return 0;\
|
||||
if (pos == BURN_POS_END)\
|
||||
pos = TO->NEW##s;\
|
||||
if (pos > TO->NEW##s)\
|
||||
if ((int) pos > TO->NEW##s)\
|
||||
return 0;\
|
||||
\
|
||||
tmp = realloc(TO->NEW, sizeof(struct NEW *) * (TO->NEW##s + 1));\
|
||||
@ -170,6 +171,8 @@ struct burn_track *burn_track_create(void)
|
||||
/* ts A61031 */
|
||||
t->open_ended = 0;
|
||||
t->track_data_done = 0;
|
||||
/* ts B10103 */
|
||||
t->end_on_premature_eoi = 0;
|
||||
|
||||
t->postgap = 0;
|
||||
t->pregap1 = 0;
|
||||
@ -267,13 +270,14 @@ void burn_track_define_data(struct burn_track *t, int offset, int tail,
|
||||
int burn_sector_length(int tracktype);
|
||||
unsigned char ctladr;
|
||||
int form = -1; /* unchanged form will be considered an error too */
|
||||
char msg[80];
|
||||
|
||||
type_to_form(mode, &ctladr, &form);
|
||||
if (form == -1 || burn_sector_length(mode) <= 0) {
|
||||
char msg[160];
|
||||
|
||||
sprintf(msg, "Attempt to set track mode to unusable value %d",
|
||||
mode);
|
||||
sprintf(msg,
|
||||
"Attempt to set track mode to unusable value 0x%X",
|
||||
(unsigned int) mode);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00020115,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
@ -444,14 +448,16 @@ int burn_track_set_fillup(struct burn_track *t, int fill_up_media)
|
||||
int burn_track_apply_fillup(struct burn_track *t, off_t max_size, int flag)
|
||||
{
|
||||
int max_sectors, ret = 2;
|
||||
char msg[160];
|
||||
char msg[80];
|
||||
|
||||
if (t->fill_up_media <= 0)
|
||||
return 2;
|
||||
max_sectors = max_size / 2048;
|
||||
if (burn_track_get_sectors(t) < max_sectors || (flag & 1)) {
|
||||
sprintf(msg, "Setting total track size to %ds (payload %ds)\n",
|
||||
max_sectors, (int) (t->source->get_size(t->source)/2048));
|
||||
max_sectors & 0x7fffffff,
|
||||
(int) ((t->source->get_size(t->source) / 2048)
|
||||
& 0x7fffffff));
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
msg, 0, 0);
|
||||
@ -577,11 +583,12 @@ int burn_session_get_hidefirst(struct burn_session *session)
|
||||
/* ts A80808 : Enhance CD toc to DVD toc */
|
||||
int burn_disc_cd_toc_extensions(struct burn_disc *d, int flag)
|
||||
{
|
||||
int sidx= 0, tidx= 0;
|
||||
int sidx= 0, tidx= 0, ret;
|
||||
struct burn_toc_entry *entry, *prev_entry= NULL;
|
||||
/* ts A81126 : ticket 146 : There was a SIGSEGV in here */
|
||||
char msg_data[321], *msg;
|
||||
char *msg_data = NULL, *msg;
|
||||
|
||||
BURN_ALLOC_MEM(msg_data, char, 321);
|
||||
strcpy(msg_data,
|
||||
"Damaged CD table-of-content detected and truncated.");
|
||||
strcat(msg_data, " In burn_disc_cd_toc_extensions: ");
|
||||
@ -644,12 +651,15 @@ int burn_disc_cd_toc_extensions(struct burn_disc *d, int flag)
|
||||
prev_entry = entry;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
failure:
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x0002015f,
|
||||
LIBDAX_MSGS_SEV_MISHAP, LIBDAX_MSGS_PRIO_HIGH, msg_data, 0, 0);
|
||||
d->sessions= sidx;
|
||||
return 0;
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg_data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -55,6 +55,14 @@ struct burn_track
|
||||
int open_ended;
|
||||
/** End of open ended track flag : offset+payload+tail are delivered */
|
||||
int track_data_done;
|
||||
/* ts B10103 */
|
||||
/** End track writing on premature End-of-input if source is of
|
||||
defined length.
|
||||
0= normal operation in case of eoi
|
||||
1= be ready to end track writing on eoi
|
||||
2= eoi was encountered with previously set value of 1
|
||||
*/
|
||||
int end_on_premature_eoi;
|
||||
|
||||
/** The audio/data mode for the entry. Derived from control and
|
||||
possibly from reading the track's first sector. */
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2011 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -20,6 +21,7 @@
|
||||
#include "libburn.h"
|
||||
#include "sector.h"
|
||||
#include "options.h"
|
||||
#include "init.h"
|
||||
|
||||
#if 0
|
||||
static void write_clonecd2(volatile struct toc *toc, int f);
|
||||
@ -105,15 +107,14 @@ void toc_find_modes(struct burn_drive *d)
|
||||
{
|
||||
struct burn_read_opts o;
|
||||
int lba;
|
||||
int i, j;
|
||||
struct buffer mem;
|
||||
int i, j, ret;
|
||||
struct buffer *mem = NULL;
|
||||
struct burn_toc_entry *e;
|
||||
|
||||
/* ts A61008 : to be prevented on the higher levels */
|
||||
/* a ssert(d->busy); */
|
||||
BURN_ALLOC_MEM(mem, struct buffer, 1);
|
||||
|
||||
mem.bytes = 0;
|
||||
mem.sectors = 1;
|
||||
mem->bytes = 0;
|
||||
mem->sectors = 1;
|
||||
o.raw = 1;
|
||||
o.c2errors = 0;
|
||||
o.subcodes_audio = 1;
|
||||
@ -141,10 +142,13 @@ void toc_find_modes(struct burn_drive *d)
|
||||
t->mode = BURN_MODE1;
|
||||
/* ts A70519 : this does not work with GNU/Linux 2.4 USB because one cannot
|
||||
predict the exact dxfer_size without knowing the sector type.
|
||||
mem.sectors = 1;
|
||||
d->read_sectors(d, lba, mem.sectors, &o, &mem);
|
||||
t->mode = sector_identify(mem.data);
|
||||
mem->sectors = 1;
|
||||
d->read_sectors(d, lba, mem.sectors, &o, mem);
|
||||
t->mode = sector_identify(mem->data);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
ex:
|
||||
BURN_FREE_MEM(mem);
|
||||
}
|
||||
|
@ -134,6 +134,8 @@ struct burn_drive
|
||||
1=MMC drive ,
|
||||
2=stdio random read-write
|
||||
3=stdio sequential write-only
|
||||
4=stdio random read-only
|
||||
5=stdio random write-only
|
||||
*/
|
||||
int drive_role;
|
||||
|
||||
@ -206,6 +208,11 @@ struct burn_drive
|
||||
*/
|
||||
int current_feat2fh_byte4;
|
||||
|
||||
/* ts B10524 : whether the damage bit was set for the future track.
|
||||
bit0= damage bit , bit1= nwa valid bit
|
||||
*/
|
||||
int next_track_damaged;
|
||||
|
||||
/* ts A70114 : whether a DVD-RW media holds an incomplete session
|
||||
(which could need closing after write) */
|
||||
int needs_close_session;
|
||||
@ -285,12 +292,25 @@ struct burn_drive
|
||||
0x7fffffff = unknown */
|
||||
int media_read_capacity;
|
||||
|
||||
/* ts B10314 : Next Writeable Adress for drive_role == 5 */
|
||||
int role_5_nwa;
|
||||
|
||||
int toc_temp;
|
||||
struct burn_disc *disc; /* disc structure */
|
||||
int block_types[4];
|
||||
struct buffer *buffer;
|
||||
struct burn_progress progress;
|
||||
|
||||
/* To be used by mmc.c, sbc.c, spc.c for SCSI commands where the struct
|
||||
content surely does not have to persist while another command gets
|
||||
composed and executed.
|
||||
(Inherently, sending SCSI commands to the same drive cannot be
|
||||
thread-safe. But there are functions which send SCSI commands
|
||||
and also call other such functions. These shall use own allocated
|
||||
command structs and not this struct here.)
|
||||
*/
|
||||
struct command casual_command;
|
||||
|
||||
/* ts A70711 : keeping an eye on the drive buffer */
|
||||
off_t pessimistic_buffer_free;
|
||||
int pbf_altered;
|
||||
|
278
libburn/write.c
278
libburn/write.c
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -276,7 +276,7 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
|
||||
|
||||
/* ts A61030 */
|
||||
int burn_write_close_session(struct burn_write_opts *o, struct burn_session *s)
|
||||
int burn_write_close_session(struct burn_write_opts *o)
|
||||
{
|
||||
|
||||
/* ts A61106 */
|
||||
@ -687,7 +687,7 @@ int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
|
||||
ret = 1;
|
||||
ex:;
|
||||
if (o->write_type == BURN_WRITE_TAO)
|
||||
burn_write_close_session(o, s);
|
||||
burn_write_close_session(o);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -999,15 +999,18 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
{
|
||||
enum burn_write_types wt;
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[160], *reason_pt;
|
||||
char *msg = NULL, *reason_pt;
|
||||
int no_media = 0;
|
||||
|
||||
reason_pt= reasons;
|
||||
reasons[0] = 0;
|
||||
|
||||
if (d->drive_role == 0) {
|
||||
sprintf(reasons,
|
||||
"DRIVE: is a virtual placeholder (null-drive)");
|
||||
if (d->drive_role == 0 || d->drive_role == 4) {
|
||||
if (d->drive_role == 0)
|
||||
sprintf(reasons,
|
||||
"DRIVE: is a virtual placeholder (null-drive)");
|
||||
else
|
||||
sprintf(reasons, "DRIVE: read-only pseudo drive");
|
||||
no_media = 1;
|
||||
goto ex;
|
||||
}
|
||||
@ -1024,7 +1027,7 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
reason_pt= reasons + strlen(reasons);
|
||||
if (d->status == BURN_DISC_UNSUITABLE)
|
||||
goto unsuitable_profile;
|
||||
if (d->drive_role == 2 ||
|
||||
if (d->drive_role == 2 || d->drive_role == 5 ||
|
||||
d->current_profile == 0x1a || d->current_profile == 0x12 ||
|
||||
d->current_profile == 0x43) {
|
||||
/* DVD+RW , DVD-RAM , BD-RE, emulated drive on stdio file */
|
||||
@ -1053,13 +1056,18 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
strcat(reasons, "write start address not supported, ");
|
||||
} else {
|
||||
unsuitable_profile:;
|
||||
sprintf(msg, "Unsuitable media detected. Profile %4.4Xh %s",
|
||||
d->current_profile, d->current_profile_text);
|
||||
if (!silent)
|
||||
msg = calloc(1, 160);
|
||||
if (msg != NULL && !silent) {
|
||||
sprintf(msg,
|
||||
"Unsuitable media detected. Profile %4.4Xh %s",
|
||||
d->current_profile, d->current_profile_text);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x0002011e,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
}
|
||||
if (msg != NULL)
|
||||
free(msg);
|
||||
strcat(reasons, "no suitable media profile detected, ");
|
||||
return 0;
|
||||
}
|
||||
@ -1089,10 +1097,11 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s, int tnum)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[160];
|
||||
char *msg = NULL;
|
||||
int ret, lba, nwa;
|
||||
off_t size;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
d->send_write_parameters(d, o);
|
||||
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||
sprintf(msg,
|
||||
@ -1119,11 +1128,13 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
#endif
|
||||
|
||||
if (o->write_type == BURN_WRITE_SAO) { /* DAO */
|
||||
/* Round track size up to write chunk size and reserve track */
|
||||
size = ((off_t) burn_track_get_sectors(s->track[tnum]))
|
||||
* (off_t) 2048;
|
||||
if (size % o->obs)
|
||||
|
||||
/* Eventually round track size up to write chunk */
|
||||
if (o->obs_pad && (size % o->obs))
|
||||
size += (off_t) (o->obs - (size % o->obs));
|
||||
|
||||
ret = d->reserve_track(d, size);
|
||||
if (ret <= 0) {
|
||||
sprintf(msg, "Cannot reserve track of %.f bytes",
|
||||
@ -1132,10 +1143,13 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
0x00020138,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1144,10 +1158,11 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s, int tnum)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[160];
|
||||
char *msg;
|
||||
int ret, lba, nwa;
|
||||
off_t size;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||
sprintf(msg,
|
||||
"DVD+R pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d",
|
||||
@ -1164,6 +1179,10 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
/* Round track size up to write chunk size and reserve track */
|
||||
size = ((off_t) burn_track_get_sectors(s->track[tnum]))
|
||||
* (off_t) 2048;
|
||||
/* o->obs should be 32k or 64k already. But 32k alignment
|
||||
was once performed in d->reserve_track() */
|
||||
if (o->obs % 32768)
|
||||
o->obs += 32768 - (o->obs % 32768);
|
||||
if (size % o->obs)
|
||||
size += (off_t) (o->obs - (size % o->obs));
|
||||
ret = d->reserve_track(d, size);
|
||||
@ -1174,16 +1193,18 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
0x00020138,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* ts A70129 */
|
||||
int burn_disc_close_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s, int tnum)
|
||||
int burn_disc_close_track_dvd_minus_r(struct burn_write_opts *o, int tnum)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[80];
|
||||
@ -1240,7 +1261,7 @@ int burn_disc_finalize_dvd_plus_r(struct burn_write_opts *o)
|
||||
|
||||
/* ts A70226 */
|
||||
int burn_disc_close_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s, int tnum, int is_last_track)
|
||||
int tnum, int is_last_track)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[80];
|
||||
@ -1432,20 +1453,6 @@ int burn_dvd_write_track(struct burn_write_opts *o,
|
||||
|
||||
sectors = burn_track_get_sectors(t);
|
||||
open_ended = burn_track_is_open_ended(t);
|
||||
/* <<< */
|
||||
{
|
||||
char msg[160];
|
||||
|
||||
sprintf(msg,
|
||||
"DVD pre-track %2.2d : demand=%.f%s, cap=%.f\n",
|
||||
tnum+1, (double) sectors * 2048.0,
|
||||
(open_ended ? " (open ended)" : ""),
|
||||
(double) d->media_capacity_remaining);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
msg, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
/* (offset padding is done within sector_data()) */
|
||||
|
||||
@ -1505,18 +1512,18 @@ int burn_dvd_write_track(struct burn_write_opts *o,
|
||||
if (d->current_profile == 0x11 || d->current_profile == 0x14 ||
|
||||
d->current_profile == 0x15) {
|
||||
/* DVD-R, DVD-RW Sequential, DVD-R/DL Sequential */
|
||||
ret = burn_disc_close_track_dvd_minus_r(o, s, tnum);
|
||||
ret = burn_disc_close_track_dvd_minus_r(o, tnum);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
} else if (d->current_profile == 0x1b || d->current_profile == 0x2b) {
|
||||
/* DVD+R , DVD+R/DL */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, s, tnum,
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, tnum,
|
||||
is_last_track);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
} else if (d->current_profile == 0x41) {
|
||||
/* BD-R SRM */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, s, tnum,
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, tnum,
|
||||
is_last_track);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
@ -1571,8 +1578,7 @@ int burn_disc_close_session_dvd_minus_rw(struct burn_write_opts *o,
|
||||
|
||||
|
||||
/* ts A70129 : for profile 0x11 DVD-R, 0x14 DVD-RW Seq, 0x15 DVD-R/DL Seq */
|
||||
int burn_disc_close_session_dvd_minus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s)
|
||||
int burn_disc_close_session_dvd_minus_r(struct burn_write_opts *o)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
|
||||
@ -1677,7 +1683,7 @@ int burn_dvd_write_session(struct burn_write_opts *o,
|
||||
multi_mem = o->multi;
|
||||
if (!is_last_session)
|
||||
o->multi = 1;
|
||||
ret = burn_disc_close_session_dvd_minus_r(o, s);
|
||||
ret = burn_disc_close_session_dvd_minus_r(o);
|
||||
o->multi = multi_mem;
|
||||
if (ret <= 0)
|
||||
return 0;
|
||||
@ -1737,7 +1743,7 @@ int burn_disc_setup_dvd_minus_rw(struct burn_write_opts *o,
|
||||
struct burn_disc *disc)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[160];
|
||||
char msg[60];
|
||||
int ret;
|
||||
|
||||
d->nwa = 0;
|
||||
@ -1820,8 +1826,9 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
off_t default_size = 0;
|
||||
struct burn_drive *d = o->drive;
|
||||
struct burn_track *t;
|
||||
char msg[160];
|
||||
char *msg = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
d->needs_close_session = 0;
|
||||
|
||||
/* buffer flush trigger for sector.c:get_sector() */
|
||||
@ -1892,6 +1899,8 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
msg, 0, 0);
|
||||
burn_track_set_size(t, default_size);
|
||||
}
|
||||
/* Whether to fill-up last 32k buffer of track. */
|
||||
o->obs_pad = (o->write_type != BURN_WRITE_SAO);
|
||||
ret = burn_disc_setup_dvd_minus_r(o, disc);
|
||||
if (ret <= 0) {
|
||||
sprintf(msg,
|
||||
@ -1902,8 +1911,6 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
msg, 0, 0);
|
||||
goto early_failure;
|
||||
}
|
||||
/* ??? padding needed ??? cowardly doing it for now */
|
||||
o->obs_pad = 1; /* fill-up track's last 32k buffer */
|
||||
|
||||
} else if (d->current_profile == 0x1b || d->current_profile == 0x2b ||
|
||||
d->current_profile == 0x41) {
|
||||
@ -2012,9 +2019,10 @@ ex:;
|
||||
0x0002017b, LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_ZERO, msg, 0, 0);
|
||||
}
|
||||
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
early_failure:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2024,7 +2032,8 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
int sector_size, int flag)
|
||||
{
|
||||
|
||||
/* <<< We need _LARGEFILE64_SOURCE defined by the build system.
|
||||
/* We normally need _LARGEFILE64_SOURCE defined by the build system.
|
||||
Nevertheless the system might use large address integers by default.
|
||||
*/
|
||||
#ifndef O_LARGEFILE
|
||||
#define O_LARGEFILE 0
|
||||
@ -2032,15 +2041,27 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
|
||||
int fd = -1;
|
||||
int mode = O_RDWR | O_CREAT | O_LARGEFILE;
|
||||
char msg[160];
|
||||
char msg[60];
|
||||
off_t lseek_res;
|
||||
|
||||
if(d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
return 0;
|
||||
}
|
||||
if (d->drive_role == 5 || d->drive_role == 3)
|
||||
mode = O_WRONLY | O_CREAT | O_LARGEFILE;
|
||||
if (d->devname[0] == 0) /* null drives should not come here */
|
||||
return -1;
|
||||
fd = burn_drive__fd_from_special_adr(d->devname);
|
||||
if (fd >= 0)
|
||||
fd = dup(fd); /* check validity and make closeable */
|
||||
else
|
||||
fd = open(d->devname, mode, S_IRUSR | S_IWUSR);
|
||||
fd = open(d->devname, mode,
|
||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||
if (fd == -1) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020005,
|
||||
@ -2051,10 +2072,11 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
}
|
||||
if (start_byte < 0)
|
||||
start_byte = 0;
|
||||
if (d->drive_role == 2)
|
||||
if (lseek(fd, start_byte, SEEK_SET)==-1) {
|
||||
if (d->drive_role == 2 || d->drive_role == 5) {
|
||||
lseek_res = lseek(fd, start_byte, SEEK_SET);
|
||||
if (lseek_res == -1) {
|
||||
sprintf(msg, "Cannot address start byte %.f",
|
||||
(double) start_byte);
|
||||
(double) start_byte);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020147,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
@ -2063,6 +2085,7 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
d->cancel = 1;
|
||||
fd = -1;
|
||||
}
|
||||
}
|
||||
d->nwa = start_byte / sector_size;
|
||||
return fd;
|
||||
}
|
||||
@ -2240,21 +2263,23 @@ int burn_stdio_slowdown(struct burn_drive *d, struct timeval *prev_time,
|
||||
int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
int tnum, int flag)
|
||||
{
|
||||
int open_ended, bufsize, ret, sectors, fd;
|
||||
int open_ended, bufsize = 16 * 2048, ret, sectors, fd;
|
||||
struct burn_track *t = s->track[tnum];
|
||||
struct burn_drive *d = o->drive;
|
||||
char buf[16*2048];
|
||||
char *buf = NULL;
|
||||
int i, prev_sync_sector = 0;
|
||||
struct buffer *out = d->buffer;
|
||||
struct timeval prev_time;
|
||||
|
||||
bufsize = sizeof(buf);
|
||||
BURN_ALLOC_MEM(buf, char, bufsize);
|
||||
fd = d->stdio_fd;
|
||||
|
||||
sectors = burn_track_get_sectors(t);
|
||||
burn_disc_init_track_status(o, s, tnum, sectors);
|
||||
open_ended = burn_track_is_open_ended(t);
|
||||
|
||||
t->end_on_premature_eoi = (o->write_type == BURN_WRITE_TAO);
|
||||
|
||||
/* attach stdio emulators for mmc_*() functions */
|
||||
if (o->simulate)
|
||||
d->write = burn_stdio_mmc_dummy_write;
|
||||
@ -2267,8 +2292,9 @@ int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
/* transact a (CD sized) sector */
|
||||
if (!sector_data(o, t, 0))
|
||||
{ret= 0; goto ex;}
|
||||
if (open_ended) {
|
||||
if (open_ended)
|
||||
d->progress.sectors = sectors = d->progress.sector;
|
||||
if (open_ended || t->end_on_premature_eoi) {
|
||||
if (burn_track_is_data_done(t))
|
||||
break;
|
||||
}
|
||||
@ -2295,6 +2321,9 @@ int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
ex:;
|
||||
if (d->cancel)
|
||||
burn_source_cancel(t->source);
|
||||
if (t->end_on_premature_eoi == 2)
|
||||
d->cancel = 1;
|
||||
BURN_FREE_MEM(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2323,6 +2352,9 @@ int burn_stdio_write_sync(struct burn_write_opts *o,
|
||||
/* open target file */
|
||||
if (d->stdio_fd >= 0)
|
||||
close(d->stdio_fd);
|
||||
if (d->drive_role == 5 && d->status == BURN_DISC_APPENDABLE &&
|
||||
o->start_byte < 0)
|
||||
o->start_byte = d->role_5_nwa * 2048;
|
||||
d->stdio_fd = burn_stdio_open_write(d, o->start_byte, 2048, 0);
|
||||
if (d->stdio_fd == -1)
|
||||
{ret = 0; goto ex;}
|
||||
@ -2405,6 +2437,14 @@ calloc() seems not to have the desired effect. valgrind warns:
|
||||
d->rlba = -150;
|
||||
d->toc_temp = 9;
|
||||
|
||||
if(d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
goto fail_wo_sync;
|
||||
}
|
||||
/* ts A70904 */
|
||||
if (d->drive_role != 1) {
|
||||
ret = burn_stdio_write_sync(o, disc);
|
||||
@ -2491,6 +2531,8 @@ return crap. so we send the command, then ignore the result.
|
||||
/* print_cue(sheet);*/
|
||||
if (o->write_type == BURN_WRITE_SAO)
|
||||
d->send_cue_sheet(d, sheet);
|
||||
if (sheet->data != NULL)
|
||||
free(sheet->data);
|
||||
free(sheet);
|
||||
|
||||
if (o->write_type == BURN_WRITE_RAW) {
|
||||
@ -2612,24 +2654,33 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
{
|
||||
int alignment = 0, start, upto, chunksize, err, fd = -1, ret;
|
||||
char msg[81], *rpt;
|
||||
struct buffer buf, *buffer_mem = d->buffer;
|
||||
struct buffer *buf = NULL, *buffer_mem = d->buffer;
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
if (d->released) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020142,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is not grabbed on random access write", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if(d->drive_role == 0) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020146,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is a virtual placeholder (null-drive)", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if(d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
|
||||
if(d->drive_role == 2)
|
||||
if(d->drive_role == 2 || d->drive_role == 5)
|
||||
alignment = 2 * 1024;
|
||||
if (d->current_profile == 0x12) /* DVD-RAM */
|
||||
alignment = 2 * 1024;
|
||||
@ -2645,7 +2696,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
0x00020125,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Write start address not supported", 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if ((byte_address % alignment) != 0) {
|
||||
sprintf(msg,
|
||||
@ -2655,7 +2706,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
0x00020126,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if ((data_count % alignment) != 0) {
|
||||
sprintf(msg,
|
||||
@ -2665,22 +2716,22 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
0x00020141,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (d->busy != BURN_DRIVE_IDLE) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020140,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is busy on attempt to write random access",0,0);
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if(d->drive_role != 1) {
|
||||
fd = burn_stdio_open_write(d, byte_address, 2048, 0);
|
||||
if (fd == -1)
|
||||
return 0;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
d->busy = BURN_DRIVE_WRITING_SYNC;
|
||||
d->buffer = &buf;
|
||||
d->buffer = buf;
|
||||
|
||||
start = byte_address / 2048;
|
||||
upto = start + data_count / 2048;
|
||||
@ -2707,7 +2758,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
if(fd >= 0)
|
||||
close(fd);
|
||||
return (-(start * 2048 - byte_address));
|
||||
{ret = -(start * 2048 - byte_address); goto ex;}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2725,6 +2776,95 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
close(fd);
|
||||
d->buffer = buffer_mem;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
return 1;
|
||||
ret = 1;
|
||||
ex:
|
||||
BURN_FREE_MEM(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* ts B10527 */
|
||||
/* @param bit0= force close, even if no damage was seen
|
||||
*/
|
||||
int burn_disc_close_damaged(struct burn_write_opts *o, int flag)
|
||||
{
|
||||
struct burn_drive *d;
|
||||
int ret;
|
||||
enum burn_drive_status busy;
|
||||
|
||||
d = o->drive;
|
||||
busy = d->busy;
|
||||
|
||||
if (busy != BURN_DRIVE_IDLE) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020106,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is busy on attempt to close damaged session",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (!((d->next_track_damaged & 1) || (flag & 1))) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020187,
|
||||
LIBDAX_MSGS_SEV_NOTE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Track not marked as damaged. No action taken.",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
d->busy = BURN_DRIVE_WRITING;
|
||||
|
||||
if (d->current_profile == 0x09 || d->current_profile == 0x0a) {
|
||||
/* Close CD track and session */
|
||||
o->write_type = BURN_WRITE_TAO; /* no action without TAO */
|
||||
|
||||
/* Send mode page 5 */;
|
||||
d->send_write_parameters(d, o);
|
||||
|
||||
ret = burn_write_close_session(o);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else if(d->current_profile == 0x11 || d->current_profile == 0x14) {
|
||||
/* Close DVD-R[W] track and session */
|
||||
o->write_type = BURN_WRITE_TAO; /* no action without TAO */
|
||||
|
||||
/* Send mode page 5 */;
|
||||
d->send_write_parameters(d, o);
|
||||
|
||||
ret = burn_disc_close_track_dvd_minus_r(o, 0);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
ret = burn_disc_close_session_dvd_minus_r(o);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else if(d->current_profile == 0x1b || d->current_profile == 0x2b) {
|
||||
/* Close DVD+R track and session */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, d->last_track_no, 1);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else if(d->current_profile == 0x41) {
|
||||
/* Close BD-R track and session */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, d->last_track_no, 1);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020188,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Cannot close damaged track on given media type",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
d->busy = busy;
|
||||
/* Record with drive that repair was attempted */
|
||||
d->next_track_damaged &= ~1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ int burn_write_flush(struct burn_write_opts *o, struct burn_track *track);
|
||||
/* ts A61030 : necessary for TAO */
|
||||
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
int tnum);
|
||||
int burn_write_close_session(struct burn_write_opts *o,struct burn_session *s);
|
||||
int burn_write_close_session(struct burn_write_opts *o);
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* test/libburner.c , API illustration of burning data or audio tracks to CD */
|
||||
/* Copyright (C) 2005 - 2010 Thomas Schmitt <scdbackup@gmx.net> */
|
||||
/* Copyright (C) 2005 - 2011 Thomas Schmitt <scdbackup@gmx.net> */
|
||||
/* Provided under GPL, see also "License and copyright aspects" at file end */
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ int libburner_aquire_by_driveno(int *driveno)
|
||||
printf("\nOverview of accessible drives (%d found) :\n",
|
||||
drive_count);
|
||||
printf("-----------------------------------------------------------------------------\n");
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
if (burn_drive_get_adr(&(drive_list[i]), adr) <=0)
|
||||
strcpy(adr, "-get_adr_failed-");
|
||||
printf("%d --drive '%s' : '%s' '%s'\n",
|
||||
@ -255,7 +255,7 @@ int libburner_aquire_by_driveno(int *driveno)
|
||||
printf("Pseudo-drive \"-\" given : bus scanning done.\n");
|
||||
return 2; /* the program will end after this */
|
||||
}
|
||||
if (drive_count <= *driveno) {
|
||||
if ((int) drive_count <= *driveno) {
|
||||
fprintf(stderr,
|
||||
"Found only %d drives. Number %d not available.\n",
|
||||
drive_count, *driveno);
|
||||
@ -263,7 +263,7 @@ int libburner_aquire_by_driveno(int *driveno)
|
||||
}
|
||||
|
||||
/* Drop all drives which we do not want to use */
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
if (i == *driveno) /* the one drive we want to keep */
|
||||
continue;
|
||||
ret = burn_drive_info_forget(&(drive_list[i]),0);
|
||||
|
@ -67,7 +67,7 @@ int main()
|
||||
|
||||
newact.sa_handler = catch_int;
|
||||
sigaction(SIGINT, &newact, &oldact);
|
||||
for (i = 0; i < n_drives; i++) {
|
||||
for (i = 0; i < (int) n_drives; i++) {
|
||||
NEXT=0;
|
||||
poll_drive(i);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* test/telltoc.c , API illustration of obtaining media status info */
|
||||
/* Copyright (C) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
/* Copyright (C) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL */
|
||||
|
||||
/** Overview
|
||||
@ -178,7 +178,7 @@ int telltoc_aquire_by_driveno(int *driveno, int silent_drive)
|
||||
}
|
||||
fprintf(stderr, "Done\n");
|
||||
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
if (*driveno >= 0 && (silent_drive || *driveno != i))
|
||||
continue;
|
||||
if (burn_drive_get_adr(&(drive_list[i]), adr) <=0)
|
||||
@ -197,7 +197,7 @@ int telltoc_aquire_by_driveno(int *driveno, int silent_drive)
|
||||
/* We already made our choice via command line. (default is 0)
|
||||
So we just have to keep our desired drive and drop all others.
|
||||
*/
|
||||
if (drive_count <= *driveno) {
|
||||
if ((int) drive_count <= *driveno) {
|
||||
fprintf(stderr,
|
||||
"Found only %d drives. Number %d not available.\n",
|
||||
drive_count, *driveno);
|
||||
@ -205,7 +205,7 @@ int telltoc_aquire_by_driveno(int *driveno, int silent_drive)
|
||||
}
|
||||
|
||||
/* Drop all drives which we do not want to use */
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
if (i == *driveno) /* the one drive we want to keep */
|
||||
continue;
|
||||
ret = burn_drive_info_forget(&(drive_list[i]),0);
|
||||
|
Reference in New Issue
Block a user