X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Finterface%2Fintf_eject.c;h=87b9f7c5089fff2bb5625d947c7032e99216c6ff;hb=78e7bd3059dc2647a9786b8c531e79c5821df756;hp=7dd08a095b66edac046b495ba045a857e5bb0faa;hpb=25cd1327a67705cdecbb8754f405be01557a175b;p=vlc diff --git a/src/interface/intf_eject.c b/src/interface/intf_eject.c index 7dd08a095b..87b9f7c508 100644 --- a/src/interface/intf_eject.c +++ b/src/interface/intf_eject.c @@ -1,8 +1,8 @@ /***************************************************************************** * intf_eject.c: CD/DVD-ROM ejection handling functions ***************************************************************************** - * Copyright (C) 2001-2004 VideoLAN - * $Id: intf_eject.c,v 1.23 2004/01/06 12:02:06 zorglub Exp $ + * Copyright (C) 2001-2004 the VideoLAN team + * $Id$ * * Authors: Julien Blache for the Linux part * with code taken from the Linux "eject" command @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /** @@ -29,17 +29,16 @@ * This file contain functions to eject CD and DVD drives */ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif -#include -#include +#include #ifdef HAVE_UNISTD_H # include #endif -#include - #ifdef HAVE_FCNTL_H # include #endif @@ -48,7 +47,7 @@ # include #endif -#if defined(SYS_LINUX) && defined(HAVE_LINUX_VERSION_H) +#if defined(__linux__) && defined(HAVE_LINUX_VERSION_H) # include /* handy macro found in 2.1 kernels, but not in older ones */ # ifndef KERNEL_VERSION @@ -76,10 +75,12 @@ # include #endif +#include + /***************************************************************************** * Local prototypes *****************************************************************************/ -#if defined(SYS_LINUX) && defined(HAVE_LINUX_VERSION_H) +#if defined(__linux__) && defined(HAVE_LINUX_VERSION_H) static int EjectSCSI ( int i_fd ); #endif @@ -99,9 +100,10 @@ static int EjectSCSI ( int i_fd ); */ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) { + VLC_UNUSED(p_this); int i_ret = VLC_SUCCESS; -#ifdef SYS_DARWIN +#ifdef __APPLE__ FILE *p_eject; char *psz_disk; char sz_cmd[32]; @@ -190,7 +192,7 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) return VLC_EGENERIC; } -#if defined(SYS_LINUX) && defined(HAVE_LINUX_VERSION_H) +#if defined(__linux__) && defined(HAVE_LINUX_VERSION_H) /* Try a simple ATAPI eject */ i_ret = ioctl( i_fd, CDROMEJECT, 0 ); @@ -208,7 +210,7 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) i_ret = ioctl( i_fd, CDROMEJECT, 0 ); #else - msg_Warn( p_this, "CD-Rom ejection unsupported on this platform" ); + msg_Warn( p_this, "CD-ROM ejection unsupported on this platform" ); i_ret = -1; #endif @@ -220,7 +222,7 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) /* The following functions are local */ -#if defined(SYS_LINUX) && defined(HAVE_LINUX_VERSION_H) +#if defined(__linux__) && defined(HAVE_LINUX_VERSION_H) /***************************************************************************** * Eject using SCSI commands. Return 0 if successful *****************************************************************************/