Skip to content

Commit

Permalink
homed-manager: pass the right error variable
Browse files Browse the repository at this point in the history
(cherry picked from commit bc65a5e)
(cherry picked from commit 9799198)
  • Loading branch information
dtardon authored and bluca committed May 9, 2024
1 parent cf7fe02 commit 6d332a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/home/homed-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ static int manager_assess_image(

r = btrfs_is_subvol_fd(fd);
if (r < 0)
return log_warning_errno(errno, "Failed to determine whether %s is a btrfs subvolume: %m", path);
return log_warning_errno(r, "Failed to determine whether %s is a btrfs subvolume: %m", path);
if (r > 0)
storage = USER_SUBVOLUME;
else {
Expand Down Expand Up @@ -1424,7 +1424,7 @@ static int manager_generate_key_pair(Manager *m) {
/* Write out public key (note that we only do that as a help to the user, we don't make use of this ever */
r = fopen_temporary("/var/lib/systemd/home/local.public", &fpublic, &temp_public);
if (r < 0)
return log_error_errno(errno, "Failed to open key file for writing: %m");
return log_error_errno(r, "Failed to open key file for writing: %m");

if (PEM_write_PUBKEY(fpublic, m->private_key) <= 0)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to write public key.");
Expand All @@ -1438,7 +1438,7 @@ static int manager_generate_key_pair(Manager *m) {
/* Write out the private key (this actually writes out both private and public, OpenSSL is confusing) */
r = fopen_temporary("/var/lib/systemd/home/local.private", &fprivate, &temp_private);
if (r < 0)
return log_error_errno(errno, "Failed to open key file for writing: %m");
return log_error_errno(r, "Failed to open key file for writing: %m");

if (PEM_write_PrivateKey(fprivate, m->private_key, NULL, NULL, 0, NULL, 0) <= 0)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to write private key pair.");
Expand Down

0 comments on commit 6d332a5

Please sign in to comment.