diff options
-rw-r--r-- | Userland/Utilities/unzip.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Userland/Utilities/unzip.cpp b/Userland/Utilities/unzip.cpp index d8b69c7acc..fc5f61d955 100644 --- a/Userland/Utilities/unzip.cpp +++ b/Userland/Utilities/unzip.cpp @@ -10,11 +10,11 @@ #include <LibArchive/Zip.h> #include <LibCompress/Deflate.h> #include <LibCore/ArgsParser.h> +#include <LibCore/Directory.h> #include <LibCore/File.h> #include <LibCore/MappedFile.h> #include <LibCore/System.h> #include <sys/stat.h> -#include <unistd.h> static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet) { @@ -120,9 +120,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } if (!output_directory_path.is_null()) { - auto mkdir_error = Core::System::mkdir(output_directory_path, 0755); - if (mkdir_error.is_error() && mkdir_error.error().code() != EEXIST) - return mkdir_error.release_error(); + TRY(Core::Directory::create(output_directory_path, Core::Directory::CreateDirectories::Yes)); TRY(Core::System::chdir(output_directory_path)); } |