From: Bill F. <bil...@ca...> - 2001-07-27 17:14:40
|
On Fri, 27 Jul 2001, Daniel Caujolle-Bert wrote: > Bill Fink wrote: > > > > At least on PPC with a 2.4.6 kernel, pressing the GUI DVD button with > > no DVD in the drive causes the system to lock up hard necessitating a > > hard reset. OTOH, pressing the VCD button with nothing in the drive > > simply results in an error message: > > > > unable to open /dev/cdroms/cdrom: No such file or directory > > Yep, this is due of O_NONBLOCK flag in open call, that > made open will never return -1 if there is no disc in drive. One correction to my post. This bug may also bite VCD. The reason I got the error message for VCD was I don't have a /dev/cdroms/cdrom symlink. If I did, it may have hung my system as well. I have an enclosed patch to input_dvd.c that fixes this bug, at least for linux systems with the CDROM ioctls. It may be necessary to make a similar fix to input_vcd.c. -Thanks -Bill xine-lib-0.5.0.rc2-nodvd.patch: -------------------------------------------------------------------------------- 103c103,104 < --- > int status; > 110a112,129 > #if defined (HAVE_LINUX_CDROM_H) > else { > if ((status = ioctl(this->dvd_fd, CDROM_DRIVE_STATUS, > CDSL_CURRENT)) != CDS_DISC_OK) { > if (status < 0) > printf ("input_dvd: DVDROM ioctl error on dvd drive (%s): %s\n", DVD, > strerror(errno)); > else if (status == CDS_NO_DISC) > printf ("input_dvd: no DVD in dvd drive (%s)\n", DVD); > else > printf ("input_dvd: bad DVDROM status on dvd drive (%s): %s\n", DVD, > status); > close(this->dvd_fd); > this->dvd_fd = -1; > return -1; > } > } > #endif 440c459 < int nFiles, nFiles2; --- > int nFiles, nFiles2, status; 441a461,475 > #if defined (HAVE_LINUX_CDROM_H) > if ((status = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) != CDS_DISC_OK) { > if (status < 0) > printf ("input_dvd: DVDROM ioctl error on dvd drive (%s): %s\n", DVD, > strerror(errno)); > else if (status == CDS_NO_DISC) > printf ("input_dvd: no DVD in dvd drive (%s)\n", DVD); > else > printf ("input_dvd: bad DVDROM status on dvd drive (%s): %s\n", DVD, > status); > close(fd); > return NULL; > } > #endif > 525c559 < int nFiles3, nFiles2; --- > int nFiles3, nFiles2, status; 526a561,575 > #if defined (HAVE_LINUX_CDROM_H) > if ((status = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) != CDS_DISC_OK) { > if (status < 0) > printf ("input_dvd: DVDROM ioctl error on dvd drive (%s): %s\n", DVD, > strerror(errno)); > else if (status == CDS_NO_DISC) > printf ("input_dvd: no DVD in dvd drive (%s)\n", DVD); > else > printf ("input_dvd: bad DVDROM status on dvd drive (%s): %s\n", DVD, > status); > close(fd); > return NULL; > } > #endif > |