After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 171495 - _gnome_vfs_get_cdrom_type calls Linux-specific syscall in general case
_gnome_vfs_get_cdrom_type calls Linux-specific syscall in general case
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Build
cvs (head)
Other other
: High normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
: 314843 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-03-24 15:24 UTC by Michael Banck
Modified: 2005-11-26 13:46 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
proposed patch for 2.8 and HEAD (467 bytes, patch)
2005-03-24 15:32 UTC, Michael Banck
none Details | Review
Updated patch for CVS HEAD (1.22 KB, patch)
2005-05-08 14:54 UTC, Michael Banck
committed Details | Review

Description Michael Banck 2005-03-24 15:24:37 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).
Comment 1 Michael Banck 2005-03-24 15:32:35 UTC
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.
Comment 2 Christian Neumair 2005-05-07 10:37:08 UTC
Thanks for your bug report and your efforts! We would very much appreciate an
updated version which removes the redundant check.
Comment 3 Michael Banck 2005-05-08 14:54:21 UTC
Created attachment 46168 [details] [review]
Updated patch for CVS HEAD
Comment 4 Christian Kellner 2005-05-08 17:50:42 UTC
Fix in cvs. Thanks a lot! :)
Comment 5 Christian Kellner 2005-11-26 13:46:04 UTC
*** Bug 314843 has been marked as a duplicate of this bug. ***