libcamera: file: Check files exist()
Ensure that when we check for existence with File() it will only return if the path leads to a file, and not a directory. Device nodes which could still be opened by this class are still supported. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
@@ -458,7 +458,8 @@ bool File::exists(const std::string &name)
|
||||
if (ret < 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
/* Directories can not be handled here, even if they exist. */
|
||||
return !S_ISDIR(st.st_mode);
|
||||
}
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user