From 29046bfc055b29fa9b7b05b88275e5e6662eae9c Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Fri, 14 Dec 2018 15:24:13 +0100 Subject: [PATCH] Create the datadirectory to not fail to write the aria2 session file. Fix kiwix/kiwix-desktop#69 --- ChangeLog | 2 ++ src/aria2.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 702d8beee..22351472d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ kiwix-lib 3.1.1 feed generation. * Convert the standard opds date to our format (YYYY-MM-DD) * Remove duplicate language attribute in the libxml dumper. + * Create the datadirectory to not fail to write a file in a non-existent + directory kiwix-lib 3.1.0 =============== diff --git a/src/aria2.cpp b/src/aria2.cpp index c19cabe4b..0048ebd0f 100644 --- a/src/aria2.cpp +++ b/src/aria2.cpp @@ -26,6 +26,7 @@ Aria2::Aria2(): m_lock(PTHREAD_MUTEX_INITIALIZER) { m_downloadDir = getDataDirectory(); + makeDirectory(m_downloadDir); std::vector callCmd; std::string rpc_port = "--rpc-listen-port=" + to_string(m_port);