Ok, here is what I see with no disc in the drive:
andersen:/home/andersen % mount /cdrom1
mount: No medium found
andersen:/home/andersen % eject -h
Eject version 1.5 by Jeff Tranter (jeff_tranter@pobox.com)
[-----snip----]
andersen:/home/andersen % eject /dev/hdd
eject: open failed for `/dev/hdd': No medium found
Ok, from an strace, I see:
open("/dev/hdd", O_RDONLY) = -1 ERRNO_123 (No medium found)
Ah, I understand. The deal here is that you are taking the same path as
mount here, i.e. you are opening along the "open_for_data" path. What you
want to do here is open with a
fd = open(device, O_RDONLY | O_NONBLOCK);
This way you tell the driver that it is only being opened for subsequent
ioctl calls, so it skips the media checking and such. This is backward
compatable with 2.0.x kernels, which will ignore the O_NONBLOCK and
behave as expected also. The code in cdtool needs to be changed, as
it is not up to date.
-Erik
-- Erik B. Andersen Web: http://www.inconnect.com/~andersen/ email: andersee@debian.org --This message was written using 73% post-consumer electrons--- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/