mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-15 04:40:05 +01:00
Print better debug message for open with write mode.
This commit is contained in:
@@ -436,7 +436,6 @@ static int move_keyslot_areas(struct crypt_device *cd, off_t offset_from,
|
|||||||
|
|
||||||
devfd = device_open(device, O_RDWR);
|
devfd = device_open(device, O_RDWR);
|
||||||
if (devfd == -1) {
|
if (devfd == -1) {
|
||||||
log_dbg("Cannot open device %s.", device_path(device));
|
|
||||||
free(buf);
|
free(buf);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
@@ -488,7 +487,6 @@ static int luksmeta_header_present(struct crypt_device *cd, off_t luks1_size)
|
|||||||
|
|
||||||
devfd = device_open(device, O_RDONLY);
|
devfd = device_open(device, O_RDONLY);
|
||||||
if (devfd == -1) {
|
if (devfd == -1) {
|
||||||
log_dbg("Cannot open device %s.", device_path(device));
|
|
||||||
free(buf);
|
free(buf);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,9 @@ static int device_open_internal(struct device *device, int flags)
|
|||||||
devfd = open(device_path(device), flags);
|
devfd = open(device_path(device), flags);
|
||||||
|
|
||||||
if (devfd < 0)
|
if (devfd < 0)
|
||||||
log_dbg("Cannot open device %s.", device_path(device));
|
log_dbg("Cannot open device %s%s.",
|
||||||
|
device_path(device),
|
||||||
|
(flags & O_ACCMODE) != O_RDONLY ? " for write" : "");
|
||||||
|
|
||||||
return devfd;
|
return devfd;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user