SDL_CDOpen() fails on Linux if data track on disc is mounted in the
authorRyan C. Gordon <icculus@icculus.org>
Sun, 17 Apr 2005 10:36:03 +0000
changeset 1051091350827e08
parent 1050 8e1815fd9777
child 1052 68f607298ca9
SDL_CDOpen() fails on Linux if data track on disc is mounted in the
filesystem. Removing O_EXCL from open() call fixes this.

Problem and solution noted by "Fosters":
http://www.libsdl.org/pipermail/sdl/2005-March/068028.html
src/cdrom/linux/SDL_syscdrom.c
     1.1 --- a/src/cdrom/linux/SDL_syscdrom.c	Sun Apr 17 10:32:41 2005 +0000
     1.2 +++ b/src/cdrom/linux/SDL_syscdrom.c	Sun Apr 17 10:36:03 2005 +0000
     1.3 @@ -132,7 +132,7 @@
     1.4  	/* If it does exist, verify that it's an available CD-ROM */
     1.5  	is_cd = 0;
     1.6  	if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
     1.7 -		cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
     1.8 +		cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0);
     1.9  		if ( cdfd >= 0 ) {
    1.10  			info.cdsc_format = CDROM_MSF;
    1.11  			/* Under Linux, EIO occurs when a disk is not present.
    1.12 @@ -393,7 +393,7 @@
    1.13  
    1.14  static int SDL_SYS_CDOpen(int drive)
    1.15  {
    1.16 -	return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0));
    1.17 +	return(open(SDL_cdlist[drive], (O_RDONLY|O_NONBLOCK), 0));
    1.18  }
    1.19  
    1.20  static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)