Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stenc should detect an empty LTO drive and return a proper exit code #12

Closed
devnullzero opened this issue Aug 26, 2018 · 1 comment · Fixed by #74
Closed

stenc should detect an empty LTO drive and return a proper exit code #12

devnullzero opened this issue Aug 26, 2018 · 1 comment · Fixed by #74
Assignees
Labels
bug Something isn't working

Comments

@devnullzero
Copy link

When running stenc on a drive with not cartridge, it "waits" doing nothing.

Expected behavior:
stenc should detect an empty drive and return a proper exit code.

@scsirob
Copy link

scsirob commented Sep 17, 2019

The SCSIExecute() routine in scsiencrypt.cpp blocks when opening a device that is not ready. When the device is not ready, the Linux kernel keeps polling the drive with SCSI Test Unit Ready commands.

Change the line
sg_fd = open(tapedevice, O_RDONLY);

to
sg_fd = open(tapedevice, O_RDONLY|O_NDELAY);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants