Fix libmount devices_iterate_open_callback error handling.
This commit is contained in:
parent
265646c85f
commit
89c6f81045
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue