lkml.org 
[lkml]   [1996]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ATAPI CD-ROM locked at boot - 2.1.x

In linux.dev.kernel you write:


>I have noticed that under 2.1.13 and earlier, my ATAPI CD-ROM (Mitusmi) is
>locked on boot-up. Mounting and un-mounting the drive fixes the problem, as
>long as there is a CD in the drive. If not, the only resolution is to
>reboot.

>Any patches yet?

Patch not, but a small eject program. Yes, this works even if there is no
CD in the drive, so you can avoid the reboot :-)

Gerd

---------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <linux/cdrom.h>
#include <linux/ucdrom.h>
#include <sys/ioctl.h>

char *devname = "/dev/cdrom";
int filehandle;

int
main(int argc, char *argv[])
{
if (argc > 1) devname = argv[1];

filehandle = open(devname,O_RDONLY | O_NONBLOCK);
if (filehandle == -1) {
perror("open");
exit(1);
}
if (0 != ioctl(filehandle,CDROMEJECT,0)) {
perror("ioctl eject");
exit(1);
}
exit(0);
}

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.042 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site