Added check for ENOMEDIUM to the Linux CDROM code
authorSam Lantinga <slouken@libsdl.org>
Mon, 10 Jun 2002 20:37:39 +0000
changeset 396 11d6eed68dba
parent 395 276d0d7ba96c
child 397 283d348cb624
Added check for ENOMEDIUM to the Linux CDROM code
src/cdrom/linux/SDL_syscdrom.c
--- a/src/cdrom/linux/SDL_syscdrom.c	Mon Jun 10 20:23:26 2002 +0000
+++ b/src/cdrom/linux/SDL_syscdrom.c	Mon Jun 10 20:37:39 2002 +0000
@@ -100,8 +100,12 @@
 static void SDL_SYS_CDClose(SDL_CD *cdrom);
 
 /* Some ioctl() errno values which occur when the tray is empty */
+#ifndef ENOMEDIUM
+#define ENOMEDIUM ENOENT
+#endif
 #define ERRNO_TRAYEMPTY(errno)	\
-	((errno == EIO) || (errno == ENOENT) || (errno == EINVAL))
+	((errno == EIO)    || (errno == ENOENT) || \
+	 (errno == EINVAL) || (errno == ENOMEDIUM))
 
 /* Check a drive to see if it is a CD-ROM */
 static int CheckDrive(char *drive, char *mnttype, struct stat *stbuf)