mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +00:00
Everywhere: Move shared library checks into a common function
While we're at it, unify the various different conditions that are scattered accross the codebase.
This commit is contained in:
parent
31c634be5a
commit
80cb44afae
7 changed files with 25 additions and 6 deletions
|
@ -147,6 +147,16 @@ bool File::is_link(String const& filename)
|
|||
return S_ISLNK(st.st_mode);
|
||||
}
|
||||
|
||||
bool File::looks_like_shared_library() const
|
||||
{
|
||||
return File::looks_like_shared_library(m_filename);
|
||||
}
|
||||
|
||||
bool File::looks_like_shared_library(const String& filename)
|
||||
{
|
||||
return filename.ends_with(".so"sv) || filename.contains(".so."sv);
|
||||
}
|
||||
|
||||
bool File::exists(String const& filename)
|
||||
{
|
||||
struct stat st;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue