mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 10:17:35 +00:00
LibCore+Userland: Remove File::ensure_parent_directories
We have a much safer and more powerful alternative now, so let's move the few users over.
This commit is contained in:
parent
0fd09b2381
commit
5319e3a03f
7 changed files with 14 additions and 48 deletions
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/Directory.h>
|
||||
#include <LibCore/LockFile.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -16,7 +16,7 @@ namespace Core {
|
|||
LockFile::LockFile(char const* filename, Type type)
|
||||
: m_filename(filename)
|
||||
{
|
||||
if (!Core::File::ensure_parent_directories(m_filename))
|
||||
if (Core::Directory::create(LexicalPath(m_filename).parent(), Core::Directory::CreateDirectories::Yes).is_error())
|
||||
return;
|
||||
|
||||
m_fd = open(filename, O_RDONLY | O_CREAT | O_CLOEXEC, 0666);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue