From 89c6f81045cd8a246f5f2928bd0541db47a66818 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 21 Aug 2024 16:27:13 +0200 Subject: [PATCH] Fix libmount devices_iterate_open_callback error handling. --- libmount/devices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmount/devices.c b/libmount/devices.c index 93fff444..bdc6daf5 100644 --- a/libmount/devices.c +++ b/libmount/devices.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Jonas 'Sortie' Termansen. + * Copyright (c) 2015, 2024 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -100,7 +100,7 @@ static bool devices_iterate_open_callback(void* ctx_ptr, const char* path) { int true_errno = errno; struct stat st; - if ( lstat(path, 0) == 0 && !S_ISBLK(st.st_mode) ) + if ( lstat(path, &st) == 0 && !S_ISBLK(st.st_mode) ) return true; errno = true_errno; return false;