GNOME Bugzilla – Bug 171495
_gnome_vfs_get_cdrom_type calls Linux-specific syscall in general case
Last modified: 2005-11-26 13:46:04 UTC
Version details: Debian unstable _gnome_vfs_get_cdrom_type checks for several operating systems like BSD, Solaris and recently OS X for system-specific ways to get cdrom type information. However, if none of those OS checks is reached, the general fallback case is the Linux-specific code, ioctl (*fd, CDROM_DISC_STATUS, CDSL_CURRENT), which breaks on non-Linux systems like recently Apple OS X or (in my case) GNU/Hurd. I suggest guarding the Linux code by #ifdef __linux__ and just returning CDS_NO_INFO if none of the specific operating systems have been handled (I'll send a patch for that shortly). Alternatively, one could add __GNU__ to __APPLE__, but this is just bound to break for the next system gnome-vfs gets ported. I am not sure what the HAVE_SYS_MNTCTL_H check is for, it's not referenced in the ChangeLog, otherwise it could be moved to the end as well. I tried to build current Debian unstable (2.8.4), but roughly the same code appears in CVS HEAD as well (modulo the additional __APPLE__ check).
Created attachment 39201 [details] [review] proposed patch for 2.8 and HEAD I have not removed the (now redundant) __APPLE__ check yet. I could send an updated patch if the is desired.
Thanks for your bug report and your efforts! We would very much appreciate an updated version which removes the redundant check.
Created attachment 46168 [details] [review] Updated patch for CVS HEAD
Fix in cvs. Thanks a lot! :)
*** Bug 314843 has been marked as a duplicate of this bug. ***