mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
opal: fix debug message on failed sed-opal ioctl.
ioctl syscall always returns -1 on error (see ioctl(2)). On error the actual reason is reported via errno varible. Let's store the original errno code in the variable so that it can be printed out in debug mode. Before this fix the debug message always reported "Operation not permited" (the translation of errno EPERM (1)).
This commit is contained in:
@@ -242,6 +242,8 @@ static int opal_ioctl(struct crypt_device *cd, int fd, unsigned long rq, void *a
|
||||
|
||||
opal_ioctl_debug(cd, rq, args, false, 0);
|
||||
r = ioctl(fd, rq, args);
|
||||
if (r < 0)
|
||||
r = -errno;
|
||||
opal_ioctl_debug(cd, rq, args, true, r);
|
||||
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user