|
|
@ -33,8 +33,8 @@
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
#include <sys/ststfd.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <ustat.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
/* #include <sys/rzdisk.h>
|
|
|
|
/* #include <sys/rzdisk.h>
|
|
|
|
#include <sys/cdrom.h> */
|
|
|
|
#include <sys/cdrom.h> */
|
|
|
@ -424,13 +424,13 @@ gen_eject(struct wm_drive *d)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* On some systems, we can check to see if the CD is mounted. */
|
|
|
|
/* On some systems, we can check to see if the CD is mounted. */
|
|
|
|
struct stat stbuf;
|
|
|
|
struct stat stbuf;
|
|
|
|
struct ustat ust;
|
|
|
|
struct statfs sfsbuf;
|
|
|
|
|
|
|
|
|
|
|
|
if (fstat(d->fd, &stbuf) != 0)
|
|
|
|
if (fstat(d->fd, &stbuf) != 0)
|
|
|
|
return (-2);
|
|
|
|
return (-2);
|
|
|
|
|
|
|
|
|
|
|
|
/* Is this a mounted filesystem? */
|
|
|
|
/* Is this a mounted filesystem? */
|
|
|
|
if (ustat(stbuf.st_rdev, &ust) == 0)
|
|
|
|
if (fstatfs(d->fd, &sfsbuf) == 0)
|
|
|
|
return (-3);
|
|
|
|
return (-3);
|
|
|
|
|
|
|
|
|
|
|
|
return (ioctl(d->fd, CDROM_EJECT_CADDY, 0));
|
|
|
|
return (ioctl(d->fd, CDROM_EJECT_CADDY, 0));
|
|
|
|