When not specified, the default directories are
now ".". The workdir is relative to the current directory
and other directories are relative the the workdir.
Change-Id: I52c013e3a3c93b3f984903562cf0c56d990900e6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
/* set directories */
if (config->workdir == NULL)
- config->workdir = get_current_dir_name();
+ config->workdir = ".";
if (config->rootdir == NULL)
- config->rootdir = config->workdir;
+ config->rootdir = ".";
if (config->uploaddir == NULL)
- config->uploaddir = config->workdir;
+ config->uploaddir = ".";
// if no Angular/HTML5 rootbase let's try '/' as default
if (config->rootbase == NULL)
goto error;
}
+ /* set the directories */
mkdir(config->workdir, S_IRWXU | S_IRGRP | S_IXGRP);
if (chdir(config->workdir) < 0) {
ERROR("Can't enter working dir %s", config->workdir);
goto error;
}
+ if (afb_common_rootdir_set(config->rootdir) < 0) {
+ ERROR("failed to set common root directory");
+ goto error;
+ }
/* install hooks */
if (config->tracereq)
goto error;
}
- // set the root dir
- if (afb_common_rootdir_set(config->rootdir) < 0) {
- ERROR("failed to set common root directory");
- goto error;
- }
-
DEBUG("Init config done");
/* start the services */