summaryrefslogtreecommitdiff
path: root/src/home/homework-luks.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-07-01 15:44:39 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-07-02 12:39:26 +0200
commit1474e66a52c2d53aed91b101b9dc5fbb632b303c (patch)
treee0ab21cf7c71dfa01230bb4eee21891c32be4acd /src/home/homework-luks.c
parent55ce4e1bcb1d802fe6eef2aba84d9228fa66549b (diff)
downloadsystemd-1474e66a52c2d53aed91b101b9dc5fbb632b303c.tar.gz
homework: silence gcc warning
gcc was warning that found_fs_uuid was used unitialized. The issue stemmed from the call to open(), where gcc seemingly didn't know that errno must be negative. When that is set, we can drop some unnecessary initializations without warnings.
Diffstat (limited to 'src/home/homework-luks.c')
-rw-r--r--src/home/homework-luks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c
index 100b0e1650..0ab8e207cd 100644
--- a/src/home/homework-luks.c
+++ b/src/home/homework-luks.c
@@ -179,7 +179,7 @@ static int probe_file_system_by_path(const char *path, char **ret_fstype, sd_id1
fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NONBLOCK);
if (fd < 0)
- return -errno;
+ return negative_errno();
return probe_file_system_by_fd(fd, ret_fstype, ret_uuid);
}
@@ -1229,7 +1229,7 @@ int home_setup_luks(
PasswordCache *cache,
UserRecord **ret_luks_home) {
- sd_id128_t found_partition_uuid = SD_ID128_NULL, found_luks_uuid = SD_ID128_NULL, found_fs_uuid = SD_ID128_NULL;
+ sd_id128_t found_partition_uuid, found_fs_uuid, found_luks_uuid = SD_ID128_NULL;
_cleanup_(user_record_unrefp) UserRecord *luks_home = NULL;
_cleanup_(erase_and_freep) void *volume_key = NULL;
size_t volume_key_size = 0;