main: Ensure existence of the storage dir at startup

Previously, the storage dir has only been created after a successful
network connection, causing removal of Known Network interface from
Dbus and failure to register dir watcher until daemon is restarted.
This commit is contained in:
Tim Kourt 2019-02-06 15:13:32 -08:00 committed by Denis Kenzior
parent 3cf0184089
commit 22318ebbd5
1 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,7 @@
#include "src/simauth.h"
#include "src/adhoc.h"
#include "src/blacklist.h"
#include "src/storage.h"
#include "src/backtrace.h"
@ -470,6 +471,11 @@ int main(int argc, char *argv[])
exit_status = EXIT_FAILURE;
if (create_dirs(DAEMON_STORAGEDIR "/")) {
l_error("Failed to create " DAEMON_STORAGEDIR "/");
goto fail_dbus;
}
dbus = l_dbus_new_default(L_DBUS_SYSTEM_BUS);
if (!dbus) {
l_error("Failed to initialize D-Bus");