commit 5ca7948dfbd7cfcc84437b86dc6a5d8d08537eb3
parent cd3857f810242ff8511a148d996f935fbfd917d8
Author: James Prestwood <prestwoj@gmail.com>
Date: Fri, 18 Feb 2022 11:55:05 -0800
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.
Diffstat:
1 file changed, 0 insertions(+), 5 deletions(-)
diff --git a/src/main.c b/src/main.c
@@ -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)",