Fix libmount devices_iterate_open_callback error handling.

This commit is contained in:
Jonas 'Sortie' Termansen 2024-08-21 16:27:13 +02:00
parent 265646c85f
commit 89c6f81045

View file

@ -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;