Commit ec77fa95 authored by Ryan C. Gordon's avatar Ryan C. Gordon

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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401052
parent 901515a5
...@@ -132,7 +132,7 @@ static int CheckDrive(char *drive, char *mnttype, struct stat *stbuf) ...@@ -132,7 +132,7 @@ static int CheckDrive(char *drive, char *mnttype, struct stat *stbuf)
/* If it does exist, verify that it's an available CD-ROM */ /* If it does exist, verify that it's an available CD-ROM */
is_cd = 0; is_cd = 0;
if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) { if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0); cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0);
if ( cdfd >= 0 ) { if ( cdfd >= 0 ) {
info.cdsc_format = CDROM_MSF; info.cdsc_format = CDROM_MSF;
/* Under Linux, EIO occurs when a disk is not present. /* Under Linux, EIO occurs when a disk is not present.
...@@ -393,7 +393,7 @@ static const char *SDL_SYS_CDName(int drive) ...@@ -393,7 +393,7 @@ static const char *SDL_SYS_CDName(int drive)
static int SDL_SYS_CDOpen(int drive) static int SDL_SYS_CDOpen(int drive)
{ {
return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0)); return(open(SDL_cdlist[drive], (O_RDONLY|O_NONBLOCK), 0));
} }
static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment