]> git.sesse.net Git - vlc/blobdiff - src/interface/intf_eject.c
* Fix for iPAQ familiar Linux (untested)
[vlc] / src / interface / intf_eject.c
index 0f7232db73876a998d18981632b7c4a780d3669b..f9d1fb5f7f7c86041da3b90b829dd7502a546542 100644 (file)
@@ -2,7 +2,7 @@
  * intf_eject.c: CD/DVD-ROM ejection handling functions
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: intf_eject.c,v 1.4 2002/01/12 02:02:44 jlj Exp $
+ * $Id: intf_eject.c,v 1.6 2002/04/03 23:24:42 massiot Exp $
  *
  * Author: Julien Blache <jb@technologeek.org> for the Linux part
  *               with code taken from the Linux "eject" command
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#include <videolan/vlc.h>
+
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
 
-#include <videolan/vlc.h>
+#ifdef HAVE_UNISTD_H
+#    include <unistd.h>
+#endif
+
+#include <string.h>
 
 #ifdef HAVE_FCNTL_H
 #   include <fcntl.h>
 #   include <sys/mount.h>
 #   include <scsi/scsi.h>
 #   include <scsi/sg.h>
-#   include <scsi/scsi_ioctl.h>
+#   ifdef HAVE_SCSI_SCSI_IOCTL_H
+#      include <scsi/scsi_ioctl.h>
+#   endif
 #endif
 
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-#ifdef SYS_LINUX
+#if defined(SYS_LINUX) && defined(HAVE_SCSI_SCSI_IOCTL_H)
 static int EjectSCSI ( int i_fd );
 #endif
 
@@ -134,10 +140,12 @@ int intf_Eject( const char *psz_device )
     /* Try a simple ATAPI eject */
     i_ret = ioctl( i_fd, CDROMEJECT, 0 );
 
+#ifdef HAVE_SCSI_SCSI_IOCTL_H
     if( i_ret != 0 )
     {
         i_ret = EjectSCSI( i_fd );
     }
+#endif
 
     if( i_ret != 0 )
     {
@@ -159,7 +167,7 @@ int intf_Eject( const char *psz_device )
 
 /* The following functions are local */
 
-#ifdef SYS_LINUX
+#if defined(SYS_LINUX) && defined(HAVE_SCSI_SCSI_IOCTL_H)
 /*****************************************************************************
  * Eject using SCSI commands. Return 0 if successful
  *****************************************************************************/