diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-04-13 11:59:17 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-13 16:00:17 +0200 |
commit | f92312e778757846ccb5d311a740bf27f674e792 (patch) | |
tree | 6cf84724163f09525a71062de5b1886377298c8e /Userland/Utilities | |
parent | 72893b4f9e34a4a1cf0a316c7468915862420167 (diff) | |
download | serenity-f92312e778757846ccb5d311a740bf27f674e792.zip |
Utilities/unzip: Use Core::Directory to create output directory
Diffstat (limited to 'Userland/Utilities')
-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)); } |