main: remove unneeded stat call

Static analysis flagged that 'path' was never being checked (which
should not ever be NULL) but during that review I noticed stat()
was being called, then fstat afterwards.
This commit is contained in:
James Prestwood 2022-02-18 11:55:05 -08:00 committed by Denis Kenzior
parent cd3857f810
commit 5ca7948dfb
1 changed files with 0 additions and 5 deletions

View File

@ -429,11 +429,6 @@ static bool setup_system_key(void)
path = l_strdup_printf("%s/%s", cred_dir, key_id);
if (stat(path, &st) < 0) {
l_warn("SystemdEncrypt: Could not stat %s", path);
return false;
}
fd = open(path, O_RDONLY, 0);
if (fd < 0) {
l_warn("SystemdEncrypt: Cannot open secret: %s (%d)",