1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +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:
kleines Filmröllchen 2022-04-10 20:51:01 +02:00 committed by Andreas Kling
parent 0fd09b2381
commit 5319e3a03f
7 changed files with 14 additions and 48 deletions

View file

@ -11,6 +11,7 @@
#include <AK/JsonObject.h>
#include <AK/StringBuilder.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/Directory.h>
#include <LibCore/File.h>
#include <LibCore/SocketAddress.h>
#include <LibCore/System.h>
@ -34,8 +35,7 @@ void Service::setup_socket(SocketDescriptor& socket)
{
VERIFY(socket.fd == -1);
auto ok = Core::File::ensure_parent_directories(socket.path);
VERIFY(ok);
MUST(Core::Directory::create(LexicalPath(socket.path).parent(), Core::Directory::CreateDirectories::Yes));
// Note: we use SOCK_CLOEXEC here to make sure we don't leak every socket to
// all the clients. We'll make the one we do need to pass down !CLOEXEC later