Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
7db2e6fa
Commit
7db2e6fa
authored
Jan 12, 2002
by
Jon Lech Johansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./src/interface/intf_eject.c: MacOS X port.
parent
00ac3ff5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
+43
-2
src/interface/intf_eject.c
src/interface/intf_eject.c
+43
-2
No files found.
src/interface/intf_eject.c
View file @
7db2e6fa
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* intf_eject.c: CD/DVD-ROM ejection handling functions
* intf_eject.c: CD/DVD-ROM ejection handling functions
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: intf_eject.c,v 1.
3 2002/01/11 03:07:36 sam
Exp $
* $Id: intf_eject.c,v 1.
4 2002/01/12 02:02:44 jlj
Exp $
*
*
* Author: Julien Blache <jb@technologeek.org> for the Linux part
* Author: Julien Blache <jb@technologeek.org> for the Linux part
* with code taken from the Linux "eject" command
* with code taken from the Linux "eject" command
...
@@ -76,10 +76,51 @@ static int EjectSCSI ( int i_fd );
...
@@ -76,10 +76,51 @@ static int EjectSCSI ( int i_fd );
*****************************************************************************/
*****************************************************************************/
int
intf_Eject
(
const
char
*
psz_device
)
int
intf_Eject
(
const
char
*
psz_device
)
{
{
int
i_fd
;
int
i_ret
;
int
i_ret
;
#ifdef SYS_DARWIN
FILE
*
p_eject
;
char
*
psz_disk
;
char
sz_cmd
[
32
];
/*
* The only way to cleanly unmount the disc under MacOS X
* is to use the 'disktool' command line utility. It uses
* the non-public Disk Arbitration API, which can not be
* used by Cocoa or Carbon applications.
*/
if
(
(
psz_disk
=
(
char
*
)
strstr
(
psz_device
,
"disk"
)
)
!=
NULL
&&
strlen
(
psz_disk
)
>
4
)
{
#define EJECT_CMD "disktool -e %s 0"
snprintf
(
sz_cmd
,
sizeof
(
sz_cmd
),
EJECT_CMD
,
psz_disk
);
#undef EJECT_CMD
if
(
(
p_eject
=
popen
(
sz_cmd
,
"r"
)
)
!=
NULL
)
{
char
psz_result
[
0x200
];
i_ret
=
fread
(
psz_result
,
1
,
sizeof
(
psz_result
),
p_eject
);
pclose
(
p_eject
);
if
(
i_ret
==
0
&&
ferror
(
p_eject
)
!=
0
)
{
return
1
;
}
if
(
strstr
(
psz_result
,
"Disk Ejected"
)
!=
NULL
)
{
return
0
;
}
}
}
return
1
;
#endif
/* This code could be extended to support CD/DVD-ROM chargers */
/* This code could be extended to support CD/DVD-ROM chargers */
int
i_fd
=
0
;
i_fd
=
open
(
psz_device
,
O_RDONLY
|
O_NONBLOCK
);
i_fd
=
open
(
psz_device
,
O_RDONLY
|
O_NONBLOCK
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment