mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
basic/lock-util: log correct error
lock_generic() returns a negative errno; the message relied on errno still holding the value of the underlying call.
This commit is contained in:
1 parent
c7542b29bc
commit
81f76a0dde
1 file changed
+3
-2
@@ -226,8 +226,9 @@ int lock_generic_with_timeout(int fd, LockType type, int operation, usec_t timeo
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to flock block device in child process: %m");
|
||||
if (r == 0) {
|
||||
if (lock_generic(fd, type, operation) < 0) {
|
||||
log_error_errno(errno, "Unable to get an exclusive lock on the device: %m");
|
||||
r = lock_generic(fd, type, operation);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Unable to get an exclusive lock on the device: %m");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user