Trying to avoid SORRY messages when hitting busy hard disk /dev/hdX

This commit is contained in:
Thomas Schmitt 2008-07-14 11:28:55 +00:00
parent b1c6953b61
commit 67ca4a251a
3 changed files with 35 additions and 5 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2008.07.02.093933"
#define Cdrskin_timestamP "2008.07.14.112935"

View File

@ -524,6 +524,11 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x00020157 (FATAL,HIGH) = burn_source is not a fifo object
0x00020158 (DEBUG,LOW) = Reporting thread disposal precautions
0x00020159 (DEBUG,HIGH) = TOC Format 0 returns inconsistent data
0x0002015a (NOTE,HIGH) = Could not examine busy device
0x0002015b (HINT,HIGH) = Busy '...' seems to be a hard disk, as '...1' exists
0x0002015c (FAILURE,HIGH) = Fifo size is smaller than desired peek buffer
0x0002015d (FAILURE,HIGH) = Fifo input ended short of desired peek buffer size
0x0002015e (FATAL,HIGH) = Fifo is already under consumption when peeking
libdax_audioxtr:
0x00020200 (SORRY,HIGH) = Cannot open audio source file

View File

@ -310,6 +310,17 @@ static int sgio_test(int fd)
static int sg_handle_busy_device(char *fname, int os_errno)
{
char msg[4096];
struct stat stbuf;
int looks_like_hd= 0;
/* ts A80713 :
check existence of /dev/hdX1 as hint for hard disk rather than CD
*/
if (strncmp(fname, "/dev/hd", 7)==0) {
sprintf(msg, "%s1", fname);
if (stat(msg, &stbuf) != -1)
looks_like_hd= 1;
}
/* ts A60814 : i saw no way to do this more nicely */
if (burn_sg_open_abort_busy) {
@ -323,10 +334,24 @@ static int sg_handle_busy_device(char *fname, int os_errno)
}
/* ts A60924 : now reporting to libdax_msgs */
sprintf(msg, "Cannot open busy device '%s'", fname);
libdax_msgs_submit(libdax_messenger, -1, 0x00020001,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_LOW,
msg, os_errno, 0);
if (looks_like_hd) {
sprintf(msg, "Could not examine busy device '%s'", fname);
libdax_msgs_submit(libdax_messenger, -1, 0x0002015a,
LIBDAX_MSGS_SEV_NOTE, LIBDAX_MSGS_PRIO_LOW,
msg, os_errno, 0);
sprintf(msg,
"Busy '%s' seems to be a hard disk, as '%s1' exists. But better check.",
fname, fname);
libdax_msgs_submit(libdax_messenger, -1, 0x0002015b,
LIBDAX_MSGS_SEV_HINT, LIBDAX_MSGS_PRIO_LOW,
msg, 0, 0);
} else {
sprintf(msg, "Cannot open busy device '%s'", fname);
libdax_msgs_submit(libdax_messenger, -1, 0x00020001,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_LOW,
msg, os_errno, 0);
}
return 1;
}